I use MVC HTML Helper to render a Html DropDownList:
@Html.DropDownListFor(m => m.ParentId, menuSelectList)
I put this DropDownList in an HTML form. When press the button Submit in this form, a HTML Form Data will be created and sent in POST request. This data will contain key name ParentId with key value is DropDownList‘s selected value. How I can include DropDownList‘s selected text in this data with key name is ParentName.
1) You could use an hidden “ParentName” input, and populate it with the selected text (javascript / jQuery) when an change event is fired on your combo (DropDownList).
2) Just get the value from the key after submit (in the POST action), it should be possible (db query, for example).
3) Build your
selectListin a way that the key contains key AND value (separated by a~for example, and split the “key~value” in the POST action)I would personnaly go for second solution, but…