Page Loads again

Discussion in 'ASP .Net' started by Vincent Keller, Oct 4, 2004.

  1. 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.
     
    Vincent Keller, Oct 4, 2004
    #1
    1. Advertising

  2. Is there a Meta-refresh tag in the client code that was generated?

    --
    Girish Bharadwaj
    http://msmvps.com/gbvb
    "Vincent Keller" <> wrote in message
    news:u$AJ%...
    > 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.
    >
    >
     
    Girish Bharadwaj, Oct 4, 2004
    #2
    1. Advertising

  3. 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!
    ***************************

    "Vincent Keller" wrote:

    > 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.
    >
    >
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Oct 4, 2004
    #3
  4. 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

    "Vincent Keller" wrote:

    > 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.
    >
    >
    >
     
    =?Utf-8?B?dmluYXk=?=, Oct 4, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. amit
    Replies:
    0
    Views:
    394
  2. che
    Replies:
    2
    Views:
    501
  3. abcd

    Importing again and again

    abcd, Jun 8, 2006, in forum: Python
    Replies:
    9
    Views:
    330
    Maric Michaud
    Jun 9, 2006
  4. Replies:
    4
    Views:
    407
  5. Ò»Ê×Ê«

    A design problem I met again and again.

    Ò»Ê×Ê«, Apr 1, 2009, in forum: Python
    Replies:
    24
    Views:
    728
    Dennis Lee Bieber
    Apr 4, 2009
Loading...

Share This Page