Bunch's Blog

One day I'll have a catchy subtitle, one day
posts - 83, comments - 94, trackbacks - 0

My Links

News

Tag Cloud

Archives

Green

Control Parameters and DropDownList Text

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:

Print | posted on Friday, February 18, 2011 10:57 AM |

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: