1

如何在用户控件中的 Imagebutton 的单击事件上打开 radwindow?此外,我在 aspx 页面中使用了相同的代码,它工作正常。

汽车.ascx

car.ascx.cs 后面的代码

protected void btnCarLogo_Click(object sender, ImageClickEventArgs e)
{
  carurl="https://www.google.co.in/"

   ScriptManager.RegisterStartupScript(this, this.GetType(), "popCarWindow", "window.radopen('" + carurl + "', 'CarDetails');", true);
}
4

3 回答 3

2

它具有VisibleOnPageLoad属性。如果将其设置为true,则回发后窗口将可见。

例子:

橱窗

myRadWindow.VisibleOnPageLoad = true;

隐藏窗口

myRadWindow.VisibleOnPageLoad = false;
于 2013-04-26T17:35:18.560 回答
1

Take a look here: http://www.telerik.com/community/forums/aspnet-ajax/window/opening-radwindow-from-the-server.aspx and see that the parameters are Page and not this (i.e. UserCOntrol).

Here is on working with JS functio nnames in user controls: http://www.telerik.com/support/kb/aspnet-ajax/general/using-dynamic-unique-names-for-javascript-functions.aspx

And, if you are going to have more than one manager on the page: http://www.telerik.com/help/aspnet-ajax/radwindow-troubleshooting-wrong-window-opened.html.

于 2013-05-14T15:00:56.803 回答
0

这样,您可能会收到错误消息,指出窗口为空

像这样尝试:背后的代码:

string script = "<script language='javascript' type='text/javascript'>Sys.Application.add_load(ShowWindow);</script>";

ClientScript.RegisterStartupScript(this.GetType(), "showWindow", script);   

然后在你的 aspx 上:

<script type="text/javascript">   
    function ShowWindow()   
    {   
        var oWnd = window.radopen('https://www.google.co.in/', 'window1');   
    }       
</script>  
于 2013-04-26T15:51:13.743 回答