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::
VB.NET:
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.
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.