Cannot Find Control?
-
Hi, Can anybody help me in the following problem? In my application I am creating controls(check box,dropdownlist etc) dynamically.This will be created inside table which inside a panel. This controls will be created on a button click. I need the values entered in the controls in other button click. But when I tried using findcontrol like
Dim ddltab As DropDownList ddltab = New DropDownList ddltab = FindControl("tddltabs_" + i.ToString)
I couldn't get the control. It is "Nothing". I tried with "panelName.FindControl" also. But no use. Any idea why this is happening? I cannot get the control values which is created in button click under another button click. Please show me the right way. Thank You, Siju Thomas -
Hi, Can anybody help me in the following problem? In my application I am creating controls(check box,dropdownlist etc) dynamically.This will be created inside table which inside a panel. This controls will be created on a button click. I need the values entered in the controls in other button click. But when I tried using findcontrol like
Dim ddltab As DropDownList ddltab = New DropDownList ddltab = FindControl("tddltabs_" + i.ToString)
I couldn't get the control. It is "Nothing". I tried with "panelName.FindControl" also. But no use. Any idea why this is happening? I cannot get the control values which is created in button click under another button click. Please show me the right way. Thank You, Siju ThomasFindControl("tddltabs_" + i.ToString) this search for a control named tddltabs_i(1), coolsweety
-
FindControl("tddltabs_" + i.ToString) this search for a control named tddltabs_i(1), coolsweety
Hi, Control name need to be findout from the index "i". In the loop i will get values from 0 to 9. So the control.ID =tddltabs_0,tddltabs_1 etc. I tried findcontrol inside the loop only by incrementing "i" from 0 to 9. What will be the problem..? Thank You, RPM.
-
Hi, Can anybody help me in the following problem? In my application I am creating controls(check box,dropdownlist etc) dynamically.This will be created inside table which inside a panel. This controls will be created on a button click. I need the values entered in the controls in other button click. But when I tried using findcontrol like
Dim ddltab As DropDownList ddltab = New DropDownList ddltab = FindControl("tddltabs_" + i.ToString)
I couldn't get the control. It is "Nothing". I tried with "panelName.FindControl" also. But no use. Any idea why this is happening? I cannot get the control values which is created in button click under another button click. Please show me the right way. Thank You, Siju ThomasHi, I see that,when controls are creating dynamically ,if we create it in "Page_Load","Page_Init" etc events then only we can find that control. If we create it in any button click it cannot be find by findcontrol.Is this is a issue of VS.2003. Is it resolved in VS2005? Thank You, RPM. :-D
-
Hi, Can anybody help me in the following problem? In my application I am creating controls(check box,dropdownlist etc) dynamically.This will be created inside table which inside a panel. This controls will be created on a button click. I need the values entered in the controls in other button click. But when I tried using findcontrol like
Dim ddltab As DropDownList ddltab = New DropDownList ddltab = FindControl("tddltabs_" + i.ToString)
I couldn't get the control. It is "Nothing". I tried with "panelName.FindControl" also. But no use. Any idea why this is happening? I cannot get the control values which is created in button click under another button click. Please show me the right way. Thank You, Siju ThomasTry to save the controls you create in a ConrtolColection, or in an array, keep the collection on the session, and instead of searching a control that you don't know the id, just take it from the array note that if this control is in a ascx of your own, the final id won't be tddltabs_#, it will be something like custControl_tdltabs_# Mihai Voicu Drebot