Geeks With Blogs
Bunch's Blog One day I'll have a catchy subtitle, one day

This is something that I rarely need to do, grab a DropDownList’s selected item’s text for use in a datasource’s ControlParameter. To allow for this use SelectedItem.Text instead of the more common SelectedValue for the PropertyName.

<asp:ControlParameter ControlID="ddlStuff" Name="stuffName" Type="String" PropertyName="SelectedItem.Text" />

The reason for using this is for text comparison. On rare occasions you may need to check the text against a list where the SelectedValue just does not help.

Technorati Tags:
Posted on Friday, February 18, 2011 10:57 AM | Back to top


Comments on this post: Control Parameters and DropDownList Text

# re: Control Parameters and DropDownList Text
Requesting Gravatar...
I Have the same need currently, did you find the answer to this?
Left by Javier on Jun 13, 2012 11:51 AM

Your comment:
 (will show your gravatar)


Copyright © Bunch | Powered by: GeeksWithBlogs.net