Thanks for the advice, actually, all controls exit already, it is just
a matter that I need to make them visible. I tried to your suggested
syntax, but it doesn't work, it just retrun nothing.
Please advice and thanks in advance.
On Aug 27, 4:28 pm, Milosz Skalecki [MCAD] <mily...@DONTLIKESPAMwp.pl>
wrote:
Hi there,
Use FindControl method of the containing control. For instance, if dynamiccontrolsare added into a panel try:
dd = CType(myPanelId.FindControl("dd" + CStr(i)), DropDownList)
Should help.
P.S. Remember dynamiccontrolshave to be recreated on every postback.
--
Milosz
"sweetpota...@yahoo.com" wrote:
Hi,
I am try to populate a number of dropdownlist with the same item,
for i = 1 to 5
dd = me.controls("dd" + Cstr(i))
itm = new listiem
itm.text ="abc"
itm.value ="aaa"
dd.add(itm)
next i
But I am getting the following error
"Conversion from string "dd1" to type 'Integer' is not valid"
when it hits this line.
dd = me.controls("dd" + Cstr(i))
Please help. I just wonder how I can refer to a control to a page
dynamically
Thanks in advance.- Hide quoted text -
- Show quoted text -