Control Panel
Forum
Hosting Help
6 Months free Hosting (New!)
Resources
Login
Members
Shared Hosting
|
New Features
|
Advertise
|
Tutorials
|
Product Reviews in India
|
Free aptitude test questions
|
TATA Nano Car reviews
Total
members
:
82077
Average new registrations per day (in last 7 days):
44
New Registration:
Open
Register Now
Home
»
Questions & Answers
»
How to assign drop downlist datasource dynamically?
How to assign drop downlist datasource dynamically?
6/10/2008
Author:
Suvendu Swain
Aptech Softwares
Hi,
I have 20 drop downlist in my page,
Named as :
DropdownList1
DropdownList2
DropdownList3
- - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - -
DropdownList20
and I have to assign the same array to all the dropdowns, so instead of assigning manually to all the drop downs I want to use for loop.
like
for(int i=1;i<=20;i++)
{
eval("DropdownList"+i).DataSource=options;
eval("DropdownList"+i).Databind();
}
But by using eval this not possible and I am unable to use the typecasting too. can any one please help regarding this.
Thanks and Regards,
Subhendu Swain
Answers .............
Author:
Suvendu Swain
Aptech Softwares
Posted Date: 6/11/2008
HelpPlz
Author:
Rod Tidwell
Posted Date: 6/21/2008
http://aspspider.info/antartica
Antartica
Hi,
You can create an array of dropdownlists or a List<DropDownList> that you populate with all your dropdownlists. Then you iterate through that list (thanks to "foreach") and do whatever you want to do.
Author:
Stephen Debreczeny
Posted Date: 7/2/2008
you can use in Page Load
"dropdownlistid.datasource = datasourcecontrolid
dropdownlistid.databind()"
You must
login
to post answer for this question.
Partners
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies.
All Rights Reserved.