127 JQuery how to disableenable all the controls on asp net page

Video ready, click here to close ×

127.In previous articles I explained Bind gridview using JQuery in asp.net and AutoComplete textbox with JQuery using asp.net and many articles relating to JQuery. Now I will explain how to disable or enable all the controls in webpage using JQuery in asp.net.

To implement this one we need to write code as shown below in your aspx page
Function :
$(document).ready(function() {
$(“#btnEnableDisable”).toggle(function() {
$(“*”).attr(“disabled”, “disabled”);
$(this).attr(“disabled”, “”);
}, function() {
$(“*”).attr(“disabled”, “”);
If you observe above code in header section I added script file link by using that file we have a chance to interact with JQuery and in the script we have btnEnableDisable button toggle function it will disable all the controls on the page including button control also because of that we need to write code to disable only particular controls instead of disable all the controls. For that check this link how to disableparticular controls on page using jquery in asp.net Follow Us On
Facebook : www.facebook.com/yoctokarthi
Twitter : www.twitter.com/yoctokarthi
Google Plus : https://plus.google.com/+YoctoKarthi
HackerRank : www.hackerrank.com/yoctokarthi
Instagram : www.instagram.com/yoctokarthi


Leave a Reply

Your email address will not be published. Required fields are marked *