This is a migrated thread and some comments may be shown as answers.

Serverside

1 Answer 22 Views
Window
This is a migrated thread and some comments may be shown as answers.
pich cock
Top achievements
Rank 1
pich cock asked on 05 Sep 2010, 04:02 PM
how can i open radwindow in serverside when i click the button...

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 06 Sep 2010, 06:02 AM
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.
Tags
Window
Asked by
pich cock
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or