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
Saurav Gurjar
1.4k
385
11.3k
Bind dropdown with selected value during edit time in MVC
Dec 10 2019 1:33 AM
Controller//
ViewBag.ddlprincepal = new SelectList(objentity.ddlPrincipal(), "PrincipalID", "PrincipalName");
ViewBag.ddlprincepalselected = new SelectListItem { Text = inventoryDetailobj[0].PrincipalName, Value = (inventoryDetailobj[0].PrincipalID).ToString(),Selected=true };
View
//
@Html.DropDownList("ddlprincepal",ViewBag.ddlprincepal as SelectList ,ViewBag.ddlprincepalselected as string , new { @id = "ddlprincepal" })
Reply
Answers (
4
)
Get Host Name in API Project
Create Scroll Bar