0

如何在 radwindow 中设置 navigateurl javascript

我想在我的页面中使用 radwindow,并在拖曳部分使用它。

我有一个 radwindow,我在 2 部分中使用它。

 <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false"
              VisibleStatusbar="false"  
         RegisterWithScriptManager="True" 
        EnableShadow="True" ReloadOnShow="true" Width="800px" Height="550px" 
      runat="server">
      <Windows>
            <telerik:RadWindow ID="modalPopup" runat="server" Modal="True"
      >
      </telerik:RadWindow>
 </Windows></telerik:RadWindowManager>

javascript用于显示 radwindow。

<telerik:RadCodeBlock runat="server" ID="rdbScripts">
      <script type="text/javascript">

          function showDialogInitially() {
              var wnd = $find("<%=modalPopup.ClientID %>");
              wnd.show();
              Sys.Application.remove_load(showDialogInitially);
          }

当我单击一个按钮时,设置Navigateurlradwindow = ("DefCall.aspx") 我单击其他按钮时,通过或其他方式设置navigateurl = ("DefTask.aspx")并将 2 值传递给子页面。QueryString

protected void btnDefCall_Click(object sender, EventArgs e)
{
        string strURL = string.Format("../PhoneCall/DefPhoneCall.aspx
    ?FormTypeID={0}&FormID={1}", number1,number2);
  modalPopup.NavigateUrl = strURL;

    ScriptManager.RegisterStartupScript(Page, GetType(), "PopupScript", string.Format("javascript:showDialogInitially()"), true);

}


 protected void btnDefTask_Click(object sender, EventArgs e)
{
    string strURL = string.Format("../Task/DefTask.aspx?FormTypeID={0}&FormID={1}", (int)clsHelper.FormType.Lead, int.Parse(Request.QueryString["ID"].ToString()));
 modalPopup.NavigateUrl = strURL;

    ScriptManager.RegisterStartupScript(Page, GetType(), "PopupScript", string.Format("javascript:showDialogInitially()"), true);
}
4

2 回答 2

3

查看RadWindow API,您可以像这样通过 javascript 更改 url

var wnd = $find("<%=modalPopup.ClientID %>");
wnd.setUrl("http://www.google.com");
于 2014-03-03T19:55:37.577 回答
0

您可以使用window.radopen。唯一的技巧是您需要使用pageLoad等待RadWindow完全加载。

protected void btnDefTask_Click(object sender, EventArgs e)
{
    var script = string.Concat(
        "function pageLoad() { showDialogInitially('",
        "http://www.telerik.com",
        "'); }");

    ScriptManager.RegisterStartupScript(Page, GetType(), 
       "PopupScript", script, true);
}

<telerik:RadWindowManager 
    ID="RadWindowManager1" 
    ShowContentDuringLoad="false"
    VisibleStatusbar="false"  
    RegisterWithScriptManager="True" 
    EnableShadow="True" 
    ReloadOnShow="true" 
    Width="800px" Height="550px" 
    runat="server">
      <Windows>
        <telerik:RadWindow ID="modalPopup" runat="server" Modal="True">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>    
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function showDialogInitially(url) {
            window.radopen(url, "modalPopup");
            return false;
        }
    </script>
</telerik:RadScriptBlock>    
于 2014-03-03T20:59:41.117 回答