|
Subject:
|
Dynamic .NET Controls.
|
|
Posted By:
|
rupen
|
Post Date:
|
2/15/2006 10:32:31 AM
|
Hi , I m trying to put dynamic control by below code: but not working. let us say put 5 dropdown controls. name will be TeamList1,TeamList2, etc. --------------------------------- <% dim i for i = 1 to 5%> <tr class="TSDeata"><td> <asp:DropDownList id="TeamList" & i runat="server"/> </td> <%next%>
---------------------------------
Rupen Anjaria. ------------------ We CAN'T avoid problems, but can solve it.
|
|
Reply By:
|
r_ganesh76
|
Reply Date:
|
2/20/2006 5:47:27 AM
|
well...i am not sure what is the problem with your code. But i can certainly tell you that this is not the right way of doing this. You dont include asp code here. You can very well do this by asp.net code itself.
Regards Ganesh
|
|
Reply By:
|
jbenson001
|
Reply Date:
|
2/20/2006 3:41:27 PM
|
Create the controls then use Me.Controls.Add(<control>)
Jim
|
|
Reply By:
|
gichin
|
Reply Date:
|
2/21/2006 4:30:29 AM
|
Is it possible to refer to a user control in the way that rupen wants?
i.e. TeamList1 to be created by id="TeamList" & "1"?
If it is, I would expect the "1" to be a string and not an integer as you have it there, Rupen. Don't think you can do it this way.
Could try id="TeamList" & i.tostring?
cheers.
|