Page Is Loading Twice...

Discussion in 'ASP .Net Web Controls' started by Art Cabot, Feb 8, 2005.

  1. Art Cabot

    Art Cabot Guest

    My page is firing the Page_Load twice on both initial load and on a button
    click. On the initial load, both times it fires "IsPostback" shows false. On
    the button clicks, "IsPostback" shows true, which I'd expect, but what could
    be making Page_Load fire twice?

    The page is populating a list box, if that's a clue, but the code to do this
    is within the If Not IsPostback...End If block.
    --
    Art Cabot
    Strickland Technical Services, Inc.
    Augusta, Georgia
    Art Cabot, Feb 8, 2005
    #1
    1. Advertising

  2. Art Cabot

    Scott M. Guest

    What makes you believe that Page_Load is fired 2 times for a given page
    request?


    "Art Cabot" <> wrote in message
    news:...
    > My page is firing the Page_Load twice on both initial load and on a button
    > click. On the initial load, both times it fires "IsPostback" shows false.
    > On
    > the button clicks, "IsPostback" shows true, which I'd expect, but what
    > could
    > be making Page_Load fire twice?
    >
    > The page is populating a list box, if that's a clue, but the code to do
    > this
    > is within the If Not IsPostback...End If block.
    > --
    > Art Cabot
    > Strickland Technical Services, Inc.
    > Augusta, Georgia
    Scott M., Feb 9, 2005
    #2
    1. Advertising

  3. Art Cabot

    Art Cabot Guest

    Because I set a breakpoint inside the "If Not IsPostback...End if" block
    that's inside the Page_Load event and it stops there twice when the page is
    first loaded (with PostBack=False) and also whenever a button click event
    occurs (with PostBack=True).

    Art

    "Scott M." wrote:

    > What makes you believe that Page_Load is fired 2 times for a given page
    > request?
    >
    >
    > "Art Cabot" <> wrote in message
    > news:...
    > > My page is firing the Page_Load twice on both initial load and on a button
    > > click. On the initial load, both times it fires "IsPostback" shows false.
    > > On
    > > the button clicks, "IsPostback" shows true, which I'd expect, but what
    > > could
    > > be making Page_Load fire twice?
    > >
    > > The page is populating a list box, if that's a clue, but the code to do
    > > this
    > > is within the If Not IsPostback...End If block.
    > > --
    > > Art Cabot
    > > Strickland Technical Services, Inc.
    > > Augusta, Georgia

    >
    >
    >
    Art Cabot, Feb 9, 2005
    #3
  4. Art Cabot

    Art Cabot Guest

    Page Is Loading Twice---Solved!

    Found the problem in the HTML of the page. For whatever reason,
    AutoEventWireup was set to "True" instead of "False". Once reset, the issue
    went away.

    "Art Cabot" wrote:

    > My page is firing the Page_Load twice on both initial load and on a button
    > click. On the initial load, both times it fires "IsPostback" shows false. On
    > the button clicks, "IsPostback" shows true, which I'd expect, but what could
    > be making Page_Load fire twice?
    >
    > The page is populating a list box, if that's a clue, but the code to do this
    > is within the If Not IsPostback...End If block.
    > --
    > Art Cabot
    > Strickland Technical Services, Inc.
    > Augusta, Georgia
    Art Cabot, Feb 9, 2005
    #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. Replies:
    5
    Views:
    710
  2. =?Utf-8?B?U2FsdmFkb3I=?=

    user control loading twice...

    =?Utf-8?B?U2FsdmFkb3I=?=, Jun 23, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    655
    =?Utf-8?B?U2FsdmFkb3I=?=
    Jun 23, 2005
  3. JSP loading twice

    , Jan 10, 2005, in forum: Java
    Replies:
    2
    Views:
    1,005
  4. Kiuhnm

    twice(twice(x))

    Kiuhnm, Apr 1, 2006, in forum: C++
    Replies:
    2
    Views:
    395
    Kiuhnm
    Apr 1, 2006
  5. Replies:
    1
    Views:
    4,977
Loading...

Share This Page