I created dropdownlist in C# code. How to display this ddlist in aspx page?
My code:
<%
DropDownList list;
for (int i = 0; i < 10; i++)
{
list = new DropDownList();
list.ID = i + "_ID";
%>
<!-- how to display drop down list here??? -->
<%
}
%>
Here is what I have in aspx code.
This code creates a web page with a panel named
PanelAmk, and nothing more.Here is what I have in aspx.cs code(C# code) which basically adds a
DropDownListto the page created above.What you are missing is adding the
DropDownListto the control with...Controls.Add(...)