Hi frnds
i am updating form in db with dropdown list in mvc
it is working fine also means updating in db.
but once i select form for update here dropdown list coimng blank i want which value i select for inserting same value should be come
when i updating in dropdown list
when i updating in dropdown list

Anjali KhanRank #1,649 · 931 reputationPosted Mar 1, 2017, 10:27 PM EST
Hi joginder
@Html.LabelFor(model => model.Type, new { @class = "control-label col-md-2" })
@Html.DropDownListFor(model => model.TYPE, new SelectList((System.Collections.IEnumerable)ViewData["ListCriteriaType"], "Value", "Text"), new { @class = "dropdown-header" })
@Html.ValidationMessageFor(model => model.TYPE, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.Data, new { @class = "control-label col-md-2" })
@Html.DropDownListFor(model => model.Data, new SelectList((System.Collections.IEnumerable)ViewData["ListCriteriaType"], "Value", "Text"), new { @class = "dropdown-header" })
@Html.ValidationMessageFor(model => model.Data, "", new { @class = "text-danger" })
{
updateViewModel um = new updateViewModel ();
um.INCIDENT_ID = id;
Filldata();
}
public ActionResult Update(dataViewModel objModel, SessionViewModel s)
{
try
{
{
(dataViewModel obj = new (dataViewModel ();
string loginId = SessionManagement.GetSessionValue(SessionManagement.SessionType.Login);
var sessionVal = objLoginDl.GetServiceSessionValues(loginId);
if (result.IsSuccess == true)
TempData["Msg"] = SuccessMessage.Replace("##msg##", result.Message);
else
TempData["Msg"] = FailureMessage.Replace("##msg##", result.Message);
ModelState.Clear();
}
}
Joginder BangerRank #360 · 7K reputationPosted Mar 1, 2017, 10:44 PM EST
Anjali KhanRank #1,649 · 931 reputationPosted Mar 1, 2017, 11:50 PM EST
Joginder BangerRank #360 · 7K reputationPosted Mar 1, 2017, 9:55 PM EST
Gnanavel SekarRank #333 · 7.5K reputationPosted Mar 2, 2017, 4:25 AM EST
Anjali KhanRank #1,649 · 931 reputationPosted Mar 2, 2017, 6:23 AM EST