TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jitendra
1.3k
430
67.5k
Dropdown list binding , is that right or rough
Sep 6 2013 1:56 PM
Code - Razor Code
<div class="editor-field">
@Html.DropDownList("CountryID", String.Empty)
@Html.ValidationMessageFor(model => model.CountryID)
</div>
Controller code
at the time on showing data in drop down list
ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "Name");
at the time of showing data on saving time
ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "Name", state.CountryID);
plz send your comment - how many types we have bind data in drop downlist
Reply
Answers (
0
)
How to Bind Dropdownl list from database in mvc3
Dropdown List Binding , is that Right or Rough in MVC