3
Reply

disabling controls is not working in my view

saranya

saranya

Nov 28 2017 12:57 AM
155
In my view:
<script type="text/javascript">
$(document).ready(function() {
var disabled = <%=ViewData["disablecontrols"].ToString()%>;
if (disabled) {
$('input,select').attr('disabled',disabled);
}
})
</script>
<input type="text"  name="patientName">
 
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();
}
 

Upload Source Code  Select only zip and rar file.
Answers (3)