asp.net mvc - MVC Html.DropDownList accessing the text field -
I have a problem reaching the text field in the selected value of Html.DropdownList.
My ViewModel is
Public class UserViewModel {public list & lt; SelectListItem & gt; Supported credits (get); Set; } Public String DefaultCurrency {get; Set; }}
My administrator displays the drop down list as a bellow.
Public List & lt; SelectListItem & gt; GetSupportedCurrencies (string setup value) {List & lt; SelectListItem & gt; Item = new list & lt; SelectListItem & gt; (); {IList & lt; Currency & gt; Mankhalal = Helper Gate-Reverted AmericYilink (Currency Services Forex Currency (Currency List in Currency List) {If (string! ISNLLER (setupview) and amp; c.CurrencyCode.Equals (setupValue)) {items.Add (New SelectListItem {text = c .CurrencyDescription, value = c.CurrencyCode, selected = true});} other {items.Add (new selection list} {{text = c. Query description, value = c.CurrencyCode});}}} hold (Exception pre) ( East) Items to return;} [AcceptVerbs (HttpVerbs.Get)] Public Performance Index () {userViewData.Suppor TedCurrency = GetSupportedCurrencies (userModelData.DefaultCurrency); Selection List Supported CurelList = New Selection List (User View Data. Supported, Currency, "Currency Code", "Currency Statement"); .........}
< / Pre> In the visual index & lt;% = Html.DropDownList ("userViewModel.DefaultCurrency", Model.SupportedCurrency)%>
............. .........
Not when I post / update I make a separate action call (update) and I want to use the currency code as well as currency descriptive me M The Drakod could but I can not go to CurrencyDescription.
Any help greatly appreciates.
a dropdown list ( & lt; select & gt;
element) Posted by a form ( & lt; option & gt;
s of post) has not been posted, you can create a mapping of the details of your server values for quick details. have to keep. Or you can just use the details of the values of both text and the SelectListItem
object.
Comments
Post a Comment