Posted on: 10/16/2013 4:51:56 PM | Views : 772

Hi,

I've got a 100 drop down lists, and I want to populate them with similar information.  I'm not sure how to search for this, and have come up empty handed.  What I want to do is write a function that will populate the control using the dropdownlist control name as the parameter ...
For example, IU want to pass the control name like this:
protected void someFunction() {    populate(DropDownList1); } 
protected void populate(string DDLcontrolNameHere) {      DDLcontrolNameHere.Items.Add("A");      DDLcontrolNameHere.Items.Add("B");      DDLcontrolNameHere.Items.Add("C"); }

I hope this is kinda clear ...  Thanks is advance

Go to the complete details ...