views:

59

answers:

1

hi my Dear Friends :

I Have A DocMenu That is working with jquery...

one of it's item is like this :

        <a class="dock-item" href="#">
            <img src="JQueryDocMenu/Images/1.png" alt="Test" /><span>Test</span></a>

i am using Telerik Rad Windiws For pop up Windows...

when i am using a button or something like that , so every thing is ok for pop up the window...

but when i am using href of that menu it seems there is a problem.

the href in that item is like this :

            <a class="dock-item" href="javascript:OpenWindow();" title="Test">
                <img src="JQueryDocMenu/Images/1.png" alt="Test" /><span></span></a>

the RadWindowManager and It's Window is Like This :

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" ReloadOnShow="True"
        ShowContentDuringLoad="False" VisibleStatusbar="False" Behavior="Default" InitialBehavior="None"
        EnableEmbeddedSkins="False" EnableEmbeddedBaseStylesheet="False" Skin="SunsetByMe"
        Font-Names="Tahoma" Style="z-index: 8000;" DestroyOnClose="True">
    <Windows>
        <telerik:RadWindow ID="window1" runat="server"
            Behavior="Close" NavigateUrl="~/a/window1.aspx"
            OnClientClose="OnClientClose"
            DestroyOnClose="True" Modal="True">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

and javascript code is like this :

<script type="text/javascript">

  function OpenWindow() {
      Sys.Application.add_load(ow);
  }

  function ow() {
      var oWnd = radopen(null, 'window1');
      Sys.Application.remove_load(ow);
  }

  function OnClientClose(oWnd, args) {

  }
</script>

the onclick event of a button that popup RadWindow (it 's ok) is like this :

protected void Button1_Click1(object sender, EventArgs e)
{
    Page.RegisterStartupScript("callWin", "<script type='text/javascript'>OpenWindow();</script>");
}

how can i fix the problem ?

thanks in future advance

A: 

Do you need to open RadWindow from the server? If not, you could simply use:

<a class="dock-item" href="javascript:void(0)" onclick="openWin(); return false">yourlink</a>
......
<script type="text/javascript">

function openWin()
{
   radopen(null, "window1")
}

</script>

If you want to open the window from the server, all you need to do is set VisibleOnPageLoad=true.

GeorgiTunev
thanks a lot / but would u please explain what javascript:void(0) exactly do?
LostLord
actually, it does nothing :D in your original code, you've used # which in certain scenarios, would make the page jump to the beginning and # to be added in the address bar as the browser will treat the link as an anchor and will try to jump to it (usually happens if FF and IE8).
GeorgiTunev