In my view:
$(document).ready(function() {
var disabled = <%=ViewData["disablecontrols"].ToString()%>;
if (disabled) {
$('input,select').attr('disabled',disabled);
}
})
On clicking New button it directs to newdetail controller
In my controller :
public ActionResult NewOperation(string button)
{
PatientDemoVM patientpersonal = new PatientDemoVM();
if (button == "New")
{
ViewData["disablecontrols"] = false;
patientpersonal.PatientCode = null;
return View("PatDemo", patientpersonal);
}
return View();
}

Midhun TpRank #388 · 6.5K reputationPosted Nov 27, 2017, 9:35 PM EST
Ramesh PalanivelRank #372 · 6.8K reputationPosted Nov 27, 2017, 9:27 PM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Nov 27, 2017, 11:45 PM EST