Take the 2-minute tour ×

Without using jQuery (can't get into why NOT right now) how do I disable an ASP.NET button from being "clickable" if a certain client-side condition is not met?

share|improve this question
why aren't you able to remove the button from asp.net ? Javascript can be disabled and any advanced user will be able to click on the button if they want to... –  VirtualTroll Jun 7 '11 at 19:51

4 Answers 4

up vote 2 down vote accepted

You can do something like this with pure javascript.

    document.getElementById("buttonClientID").disable = true;
    document.getElementById("buttonClientID").disable = false;
share|improve this answer

The button will be rendered as an <input> tag on the client side. Find the input using the standard JavaScript document.getElementById and set its disabled property to true.

share|improve this answer

OnClientClick="return false;" will prevent the post back, without disabling the button. And you can add an alert('button disabled') if wanted.

share|improve this answer

Use javascript:


or try


share|improve this answer

Your Answer


