My Little Help Desk - ASP Help Forum
My Little Help Desk - ASP Help Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
 All Forums
 My Little Help Desk - ASP Help
 Active Server Pages
 Filter dropdownlist datasource at runtime
 New Topic  Reply to Topic
Author Topic  


28 Posts

Posted - 05/09/2011 :  14:56:25  Show Profile  Reply with Quote
Ever need to filter a dropdown list bound to a data source at runtime? I thought this was going to be tough, but turns out to be really simple!

If you have a data bound dropdownlist, you can filter the datasource on page load using FilterExpression.


if somelogic = true then
odsContentWithTypeName.FilterExpression = "id in (100, 102, 103)"
'the expression can be just about any where clause
'eg. "typname = 'Test'"
end if

Happy coding!

 New Topic  Reply to Topic
Jump To:
My Little Help Desk - ASP Help Forum © Go To Top Of Page
Snitz Forums 2000