Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, How do I programmatical

Status
Not open for further replies.

chuair

Programmer
Apr 9, 2001
20
SG
Hi,

How do I programmatically add a DropDownList into a Panel or PlaceHolder?

I used:-

DropDownList ddlSite = new DropDownList();
panelSite.Controls.Add(ddlSite);

The problem with this is that two DropDownList will appear in the Panel/PlaceHolder. And then I tried adding Attributes of onselectedindexchanged but seems like it doesn't work

ddlSite.Attributes["id"] = "ddlSite";
ddlSite.Attributes["runat"] = "server";
ddlSite.Attributes["onselectedindexchanged"] = "siteChange";

Thanks




Chuair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top