How to make button work in the RadWindow?

2 posts, 1 answers
  1. Bruce Timmins
    Bruce Timmins avatar
    2 posts
    Member since:
    Oct 2006

    Posted 14 Dec 2009 Link to this post

    Hi everyone,

    I got a problem having the button work in the RadWindow control. It seems did not trigger the server side click event. Here is the code below:                
                     <telerik:RadWindow ID="radWindow1" runat="server" Behavior="Move,Close,Reload">
                                <br />
                                <asp:Button ID="btn_Popup" runat="server" Text="Load Popup" OnClick="btn_Popup_Click"/>


  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 Dec 2009 Link to this post

    Hi Bruce,

    I tried the same code and it is not working in my end also, the buttonClick event is not fired. One suggestion to achieve the scenario is placing the controls needed in UserControl and load the usercontrol in RadWindow as shown below.

        <telerik:RadWindow ID="radWindow1" runat="server" VisibleOnPageLoad="true" 
                <uc1:Content ID="Content1" runat="server" /> 
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 

    And in ascx:
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> 

        protected void Button1_Click(object sender, EventArgs e) 
            Button btn = (Button)sender; 
            UserControl uc = (UserControl)btn.NamingContainer; 
            Page p = (Page)uc.NamingContainer.Parent.NamingContainer; 
            Label lbl = (Label)p.FindControl("Label1"); // accessing the control on page 
            lbl.Text = "new text"

Back to Top