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

Get User Data from Dynamic Control in RadWindow

1 Answer 50 Views
Window
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 01 Oct 2014, 12:34 PM
Hello,

I am working on a project with a RadWindow.
Controls are added dynamically to the RadWindow. (TextBox, radioButton CheckBox etc.)
The user can enter data into the dynamic controls. 

My ASPX code::
<telerik:RadWindow runat="server" ID="RadWindow2">
                        <ContentTemplate>
                            <telerik:RadAjaxPanel ID="MyPopUp_RadAjaxPanel1" runat="server" Width="90%"></telerik:RadAjaxPanel>
                            <asp:UpdatePanel ID="Updatepanel1" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:Button ID="Button_Ajax" Text="Click for AJAX" runat="server" OnClick="Button_Ajax_Click" />
                                    <br />
                                    <asp:Label ID="Label1" Text="I will be updated" runat="server" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </ContentTemplate>
                    </telerik:RadWindow>
 
  <telerik:RadButton ID="btn_win2" runat="server" Text="win 2">
                    </telerik:RadButton>

VB.NET:
   Protected Sub btn_win2_Click(sender As Object, e As EventArgs) Handles btn_win2.Click
       Dim lbl As Label = New Label()
       Dim txt As TextBox = New TextBox()
       txt.ID = "txb_win2"
       lbl.ID = "lbl_win2"
       lbl.Text = "new lbl"
       
       MyPopUp_RadAjaxPanel1.Controls.Add(lbl)
       MyPopUp_RadAjaxPanel1.Controls.Add(txt)
       RadWindow2.VisibleOnPageLoad = True
       'RadWindow2.Width = 500
       'RadWindow2.Height = 300
       RadWindow2.Modal = True
       RadWindow2.CenterIfModal = True
   End Sub
 
Protected Sub Button_Ajax_Click(sender As Object, e As EventArgs)
       RadWindow2.VisibleOnPageLoad = False
       lbl_NewUserData.Text = ""
       'Dim panel As RadAjaxPanel = TryCast(RadWindow2.ContentContainer.FindControl("MyPopUp_RadAjaxPanel1"), RadAjaxPanel)
       For Each ct In RadAjaxPanel1.Controls
           lbl_NewUserData.Text += ct.ToString() + vbCrLf
       Next
 
   End Sub


How can I access the controls and the data which the user entered?
I want to retrieve this information when the user clicks a button.

Thanks,

Daniel.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 02 Oct 2014, 11:46 AM

Hello Daniel,

Her are some resources that should help you with this:

I hope this helps get you started.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Window
Asked by
Daniel
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or