Serverside

2 posts, 0 answers
  1. pich cock
    pich cock avatar
    4 posts
    Member since:
    Mar 2010

    Posted 05 Sep 2010 Link to this post

    how can i open radwindow in serverside when i click the button...
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Sep 2010 Link to this post

    Hello Pich,

    The following code snippet shows how to open a RadWindow from Server side.

    MarkUp:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    <Windows>
        <telerik:RadWindow runat="server" NavigateUrl="Dialog1.aspx" ID="Window1"></telerik:RadWindow>
    </Windows>
    </telerik:RadWindowManager>

    Code Behind:
    protected void Button1_Click(object sender, EventArgs e) 
        if (test)  //Condition 
        
            string script = "<script language='javascript' type='text/javascript'>Sys.Application.add_load(ShowWindow);</script>";  
            ClientScript.RegisterStartupScript(this.GetType(), "showWindow", script); 
        
    }

    Java Script:
    <script type="text/javascript"
    function ShowWindow() 
        var oWnd = window.radopen('Default2.aspx', 'Window1'); 
    }     
    </script>

    Another method is, create the window dynamically from code behind and set the property VisibleOnPageLoad to True.

    MarkUp:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    </telerik:RadWindowManager>

    Code Behind:
    protected void Button4_Click(object sender, EventArgs e) 
        if (test) 
        
            RadWindow newWindow = new RadWindow(); 
            newWindow.NavigateUrl = "Default2.aspx"
            newWindow.VisibleOnPageLoad = true
            RadWindowManager1.Windows.Add(newWindow);  
        
    }

    Regards,
    Shinu.
Back to Top