Search code examples
c#javascriptasp.nettelerikradwindow

How to refresh the page? (Click button close RadWindow)


I have 2 pages (Home and Сategory) Load page Home on there's button. Click button run panel RadWindow (NavigateUrl: Сategory).

protected void ShowWindow()
    {
        string script = "function f(){$find(\"" + RadWindow_editor.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
    }
    protected void RadButtonEdit_Click(object sender, EventArgs e)
    {
        ShowWindow();
    }

Load RadWindow NavigateUrl - Сategory on there's button. Click button close RadWindow.

protected void RadButtonEdit_Click(object sender, EventArgs e)
        {
            ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "Close();", true);
        }
 function GetRadWindow() {
     var oWindow = null;
     if (window.radWindow)
         oWindow = window.radWindow;
     else if (window.frameElement.radWindow)
         oWindow = window.frameElement.radWindow;
     return oWindow; 
 }

 function Close() {
     var oWindow = GetRadWindow();
     oWindow.argument = null;
     oWindow.close();
     return false;
 }

How to refresh the page Home? (Click button close RadWindow)

Thank you!


Solution

  • Here's how: http://www.telerik.com/community/forums/aspnet-ajax/window/how-to-refresh-the-page-click-button-close-radwindow.aspx#2894238.

    If your page does not refresh, then the problem is in the page. Having a has in the URL can cause this problem. Make sure you change the URL so you have a fresh GET request.