Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Page Is Loading Twice...

Reply
Thread Tools

Page Is Loading Twice...

 
 
Art Cabot
Guest
Posts: n/a
 
      02-08-2005
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
 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      02-09-2005
What makes you believe that Page_Load is fired 2 times for a given page
request?


"Art Cabot" <> wrote in message
news:F7C4ACA3-B417-4BDA-9D03-...
> 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



 
Reply With Quote
 
 
 
 
Art Cabot
Guest
Posts: n/a
 
      02-09-2005
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:F7C4ACA3-B417-4BDA-9D03-...
> > 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

>
>
>

 
Reply With Quote
 
Art Cabot
Guest
Posts: n/a
 
      02-09-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
order of iframe loading with document loading ofir Javascript 0 12-03-2007 12:06 PM
loading image -> detect when image is done loading edfialk Javascript 0 05-10-2007 07:28 PM
[OT] Is loading the second Java application faster than loading the first? David Segall Java 2 01-02-2007 04:41 PM
Image loading using javascript. Handling timeouts and parrallel loading under IE zborisau@gmail.com Javascript 4 08-28-2005 02:02 PM
Re: loading a html page into a aspx page Christopher Ambler ASP .Net 5 08-28-2003 09:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57