I have an Asp.net (Ver4) web page with an imageButton that is used to submit the form data to a database via the code behind of the imagebuttons click event. In the code behind I am using a response.redirect to move them to a thank you page, it is the last line in the code behind routine.
Due to the DB being a little slow sometimes I want to disable the click event until the page is redirected. I am attempting to do this with jquery. I have been able to disable the button and make it appear disabled but then my code behind is not firing at all.
This is the JQuery I am using
function test() {
$("#ImageButton1").attr("disabled", "disabled").css('opacity',' 0.5');
}
This is the aspx code for the button
<div class="button">
<asp:ImageButton ID="ImageButton1" runat="server" Height="28px"
OnClientClick="test();"
onclick="ImageButton1_Click"
ImageUrl="media/finishbutton.jpg"
style="margin-top: 0px" Width="97px" />
</div>
The easiest solution is to disable the element a little bit later after the click event has triggered. For example: