I want to put a value from database because my dropdown already have a value the same as the text so I want a separate or different value from my text. Example code = 1, text = pathologist.
My controller:
public ActionResult MainHistopathologyForm(string id)
{
var patientprofileViewModel = new MDHPIStables();
patientprofileViewModel.histopathology = db.histopathology.Find(id);
patientprofileViewModel.roles = db.roles.Find(Session["role"]);
var PathologistList = new List();
var PathologistQry = from d in db.pathologist
select d.pathologist;
PathologistList.AddRange(PathologistQry.Distinct());
TempData["pathologistlist"] = new SelectList(PathologistList);
return View(patientprofileViewModel);
}
MainHistopathologyForm.cshtml:
@Html.Partial("RolesHistopathologyForm", Model.roles, new ViewDataDictionary())
@Html.Partial("Partial_HistopathologyForm", Model.histopathology,
new ViewDataDictionary())
Partial_HistopathologyForm:
@{
ViewBag.concurring1 = TempData["pathologistlist"];
}
@Html.DropDownList("concurring1", "Select Pathologist")
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)