Hi Friends,
need a help regarding an assignment. An .aspx page with a static textbox and a button named "Generate". we have to enter a number in the textbox (say 4) then on the Generate button click four(4) dynamic dropdownlist are created and a button named "ADD" is also created. The first dynamic dropdown contains number 1 to 10 and second dynamic dropdown contains 10 to 20 and so on... On clicking the dynamically generated button "ADD" button the selected values on the four dynamically created dropdownlist will added and shown in another dynamically created label and the dropdown should contain the selected values respectively without any javascript or jquery. basically its somewhat related to page lifecycle and viewstate. Can anybody please help?
Thanking You all friends. Looking for your kind help on the issue.
Sukesh MarlaPosted Sep 20, 2012, 2:47 AM
You can acheive that, but bit complicated ,but once understood
it become more simpler
What you have to do is, Shift your code to Init method as
If (Request.Form(T1.UniqueID) <> String.Empty) Then
For i As Integer = 0 To Integer.Parse(Request.Form(T1.UniqueID)) Step 1
Dim t As New TextBox()
t.Width = New Unit(100)
p.Controls.Add(t)
Next
Dim b As New Button()
b.Width = New Unit(100)
b.Text = "Save"
p.Controls.Add(b)
End If
Hope this is helped, Check this is correct answer if it helped