Abhilash J A

Abhilash J A

  • 501
  • 2.4k
  • 598.1k

How to bind dropdownlistfor as List<string> ?

May 12 2017 4:51 AM
Hello all,
 
Thera the values of dropdownlistfor,
 
  1. public static List<string> incorporationtypelist = new List<string> { "Publicaly Held""Privately Held""Other" }; 
 And this is the text of the dropdownlistfor,
 
  1. "Public" ,"Private","Others" 
 Then, How can bind both Text and Value to drowpdownfor?
 
  1. @Html.DropDownListFor(model => model.incorporationtypelist, new SelectList(Model.incorporationtypelist, "Value", "Text"), new { @class = "form-control" }) 
 Please help me...

Answers (4)