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 KhanPosted Mar 2, 2017, 11:23 AM
Gnanavel SekarPosted Mar 2, 2017, 9:25 AM
Anjali KhanPosted Mar 2, 2017, 4:50 AM
Joginder BangerPosted Mar 2, 2017, 3:44 AM
Anjali KhanPosted Mar 2, 2017, 3:27 AM
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 BangerPosted Mar 2, 2017, 2:55 AM