Prevent an button from doing a postback

Something that bugged me for ages in was how to prevent an button from automatically doing a postback.

To prevent a postback occuring simply make the OnClientClick event return false like this:

<asp:Button ID="button" runat="server" OnClientClick='return false' />

Subscribe via RSS

Back to all blog posts