javascript Telerik RadWindows / 如何使用 DocMenu 打开 Telerik RadWindows
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3796068/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Telerik RadWindows / How Open Telerik RadWindows With A DocMenu
提问by LostLord
I Have A DocMenu That is working with jquery...
我有一个使用 jquery 的 DocMenu ...
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...
我正在使用 Telerik Rad Windiws 来弹出窗口...
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.
但是当我使用该菜单的 href 时,似乎有问题。
the href in that item is like this :
该项目中的 href 是这样的:
<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 :
RadWindowManager 和它的窗口是这样的:
<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 :
和 javascript 代码是这样的:
<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 :
弹出 RadWindow(没关系)的按钮的 onclick 事件是这样的:
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
提前感谢
回答by GeorgiTunev
Do you need to open RadWindow from the server? If not, you could simply use:
是否需要从服务器打开 RadWindow?如果没有,您可以简单地使用:
<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.
如果你想从服务器打开窗口,你需要做的就是设置 VisibleOnPageLoad=true。

