How to disable link button asp.net

{0 Comments}

To disabling a link button is bit challenging but, I am sure what so challenging in that we can do this just putting following code in the on click function of the link button and it get disabled perfectly.

 C# |  copy code |? 
1
LinkButton1.Enabled = false;

But the problem really arises when you try to disable link button from JavaScript. The main problem which is mostly stop you is the post back property this will tend to circle the drain.  Found many answer on popular forum but most of them tell you to set attribute disable but it too not work  other will tell you to set JavaScript:void(‘0’) in href but it stop only href redirecting, so finally hour of searching I comes to a conclusion that the best way to disabled a link button is from code behind that code is top of this paragraph. If you find a better way to do exactly the same from JavaScript please tell this method to all of us in the comment box thank for reading.         

Leave a Comment

Your email address will not be published.