繁体   English   中英

如何在javascript中为radwindow设置Navigationurl?

[英]How to set navigateurl for radwindow in javascript?

如何在javascript为radwindow设置Navigationurl?

我想在页面中使用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);
          }

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

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);
}

RadWindow API,您可以像这样通过javascript更改网址

var wnd = $find("<%=modalPopup.ClientID %>");
wnd.setUrl("http://www.google.com");

您可以使用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>    

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM