TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
saranya
NA
9
28.7k
disabling controls is not working in my view
Nov 28 2017 12:57 AM
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();
}
Reply
Answers (
3
)
Jquery Date Picker not working MVC
how to design database with relationship