Thursday 15 May 2014

c# - Button Click Event fired after Response.Redirect -


In the click event, I have one in the database, and one of the Response.Redirect records Preview.

The strange issue is that if I click on the button 3 times, then I will get 3 new records in the database. That's strange, because response. Redirect is executed after the first entry.

NB:

  • The button is completing the postback because I have to upload the file to the server

  • I have a response with a false-true option. Tried to redirex

  • I tried server.Transfer

    Here is my code:

      Secure void B_Save_Click (Object Sender, EventAgages e) {Insert_Account (); Response.Redirect ("index.aspx"); }   

    This button has been clicked fast and insert slower Basically, you are submitting several requests before you have a chance to come back in redirection.

    The simple solution is to block the button on the client side using Javascript. You can show some sort of processing notification, it is usually seen with submitting a shopping cart and choice.

No comments:

Post a Comment