Page Loads again

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.
 
G

Guest

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!
***************************
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top