Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
How to bind dropdownlistfor as List<string> ?
Mani Kandan
May 12 2017 4:51 AM
346
Reply
Hello all,
Thera the values of dropdownlistfor,
public
static
List<
string
> incorporationtypelist =
new
List<
string
> {
"Publicaly Held"
,
"Privately Held"
,
"Other"
};
And this is the text of the dropdownlistfor,
"Public"
,
"Private"
,
"Others"
Then, How can bind both Text and Value to drowpdownfor?
@Html.DropDownListFor(
model
=
>
model.incorporationtypelist, new SelectList(Model.incorporationtypelist, "Value", "Text"), new { @
class
=
"form-control"
})
Please help me...
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
How to Fetch Current Time from Internet?
Bad Response Error