Author: Naved Hasan Khan | Posted on: 7/17/2009 4:10:13 AM | Views : 289

Hi ALL..


I am on a webpage where controls are populated dynamically. There is an "Add" button which will add the control (any number of control) on the page.


Control Page:

This consists of a dropdown and onSelect of Dropdown, Datagrid will be displayed. However whenever we click on "add" button, another dropdown will be displayed and on select of that dropdown its corresponding datagrid will be displayed. Now m maintaining the viewstate of the number of controls on the page and giving the controlID to the controls in this fashion:
for i as integer = 0 to numberofcontrols-1
dim obj as object
obj = me.loadcontrol(" ~~ the control page url ~~ ")
obj.ID = "ControlID_" & i
pageDiv.controls.Add(obj)

next


The Issue:
Suppose there are following controls on my page .
ControlID_0
ControlID_1
...

Go to the complete details ...