Page Loads again

  • Thread starter Thread starter Vincent Keller
  • Start date Start date
V

Vincent Keller

May be I am missing something but I find this behavior odd.

I am running an application which runs a stored procedure upon clicking a
button.
The stored procedure is called in the Click event of the button

However, after some time (when the stored procedure is still executing) the
ASP.NET page code seems to load all over again (as if the page was
refreshed), including the Click event. This causes the stored procedure to
execute another time as well.

I am quite confused with this since I have seen this for the first time.
If I have just a smaller process running in the Click event instead of the
time consuming stored procedure, everything works as normal and the
application returns.

Thank you in advance for your help.
 
User Controls in the page? If so, you could be bubbling up events.
Improper use of Page_Load can also create some issues.

There are some settings in the @ directive to stop some of the behaviors
that can cause this. I would debug through and see what is causing the double
submit (client side or in the code). Some versions of IE had a double submit
bug, BTW.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
It also happens when the event has been called twice..
for EX:

OnClick="btnSubmit_Click" in aspx page

AND in codebehind page

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click

End Sub
 
Back
Top