Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Page_Load and Page_Init get called twice, sometimes! (http://www.velocityreviews.com/forums/t91348-page_load-and-page_init-get-called-twice-sometimes.html)

Dot net work 11-23-2004 09:04 AM

Page_Load and Page_Init get called twice, sometimes!
 
I've read quite a few threads on these groups about this. When
someone says the following:

"My Page_Load gets called twice on a button click postback"

The replies are:

"Do you have AutoEventWireup=True in your page header?"

In my project, I have this set to false - everywhere.

Also, if I keep repeating exactly the same button click action, over
and over again, sometimes the Page_Init and Page_Load gets called
twice, sometimes it just gets called once. It almost appears to be
random.

More specifically, my aspx page contains several web user controls.
On one web user control I have the button in question, and it's when I
click this, that the Page_Init and Page_Load of another web user
control on the same aspx form either gets called once or twice.

What should I do? Do you think something has got muddled up
internally, and I should delete some files and start again?

Thank you,
Regards, dnw.

bruce barker 11-23-2004 05:31 PM

Re: Page_Load and Page_Init get called twice, sometimes!
 
look at the generated OnInit code, and you will see the event wireup. check
for duplicate entries.

-- bruce (sqlwork.com)



"Dot net work" <dotnw@hotmail.com> wrote in message
news:77b8c5a9.0411230104.5bd18464@posting.google.c om...
| I've read quite a few threads on these groups about this. When
| someone says the following:
|
| "My Page_Load gets called twice on a button click postback"
|
| The replies are:
|
| "Do you have AutoEventWireup=True in your page header?"
|
| In my project, I have this set to false - everywhere.
|
| Also, if I keep repeating exactly the same button click action, over
| and over again, sometimes the Page_Init and Page_Load gets called
| twice, sometimes it just gets called once. It almost appears to be
| random.
|
| More specifically, my aspx page contains several web user controls.
| On one web user control I have the button in question, and it's when I
| click this, that the Page_Init and Page_Load of another web user
| control on the same aspx form either gets called once or twice.
|
| What should I do? Do you think something has got muddled up
| internally, and I should delete some files and start again?
|
| Thank you,
| Regards, dnw.



Dot Net Work 11-23-2004 09:09 PM

Re: Page_Load and Page_Init get called twice, sometimes!
 
I'm sorry, I don't know what you mean. How do I look at generated
OnInit code? I did a global search for "OnInit" in my project, and
there wasn't a match found.

Apologies for being a bit thick,
-dnw.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Tony Cheng 11-24-2004 03:37 AM

Re: Page_Load and Page_Init get called twice, sometimes!
 
Which broswer u use ?
I have faced this problem on FireFox
but it is ok on IE and netscape

"Dot net work" <dotnw@hotmail.com> wrote in message
news:77b8c5a9.0411230104.5bd18464@posting.google.c om...
> I've read quite a few threads on these groups about this. When
> someone says the following:
>
> "My Page_Load gets called twice on a button click postback"
>
> The replies are:
>
> "Do you have AutoEventWireup=True in your page header?"
>
> In my project, I have this set to false - everywhere.
>
> Also, if I keep repeating exactly the same button click action, over
> and over again, sometimes the Page_Init and Page_Load gets called
> twice, sometimes it just gets called once. It almost appears to be
> random.
>
> More specifically, my aspx page contains several web user controls.
> On one web user control I have the button in question, and it's when I
> click this, that the Page_Init and Page_Load of another web user
> control on the same aspx form either gets called once or twice.
>
> What should I do? Do you think something has got muddled up
> internally, and I should delete some files and start again?
>
> Thank you,
> Regards, dnw.




Dot net work 11-24-2004 08:28 AM

Re: Page_Load and Page_Init get called twice, sometimes!
 
I am using IE6 with Windows 2000 Professional.

"Tony Cheng" <sdasd@fdfsds.com> wrote in message news:<uOoX$bd0EHA.3072@TK2MSFTNGP11.phx.gbl>...
> Which broswer u use ?
> I have faced this problem on FireFox
> but it is ok on IE and netscape
>
> "Dot net work" <dotnw@hotmail.com> wrote in message
> news:77b8c5a9.0411230104.5bd18464@posting.google.c om...
> > I've read quite a few threads on these groups about this. When
> > someone says the following:
> >
> > "My Page_Load gets called twice on a button click postback"
> >
> > The replies are:
> >
> > "Do you have AutoEventWireup=True in your page header?"
> >
> > In my project, I have this set to false - everywhere.
> >
> > Also, if I keep repeating exactly the same button click action, over
> > and over again, sometimes the Page_Init and Page_Load gets called
> > twice, sometimes it just gets called once. It almost appears to be
> > random.
> >
> > More specifically, my aspx page contains several web user controls.
> > On one web user control I have the button in question, and it's when I
> > click this, that the Page_Init and Page_Load of another web user
> > control on the same aspx form either gets called once or twice.
> >
> > What should I do? Do you think something has got muddled up
> > internally, and I should delete some files and start again?
> >
> > Thank you,
> > Regards, dnw.


Dot net work 11-24-2004 07:34 PM

Re: Page_Load and Page_Init get called twice, sometimes!
 
The Private Sub InitializeComponent() section is always completely
empty, for all of my projects. Is that why I can't seem to find what
you are referring to?

(I'm using VB.NET and VS.Net 2002)

Thanks, dnw.


"bruce barker" <nospam_brubar@safeco.com> wrote in message news:<efEEPJY0EHA.2788@TK2MSFTNGP15.phx.gbl>...
> look at the generated OnInit code, and you will see the event wireup. check
> for duplicate entries.
>
> -- bruce (sqlwork.com)
>
>
>
> "Dot net work" <dotnw@hotmail.com> wrote in message
> news:77b8c5a9.0411230104.5bd18464@posting.google.c om...
> | I've read quite a few threads on these groups about this. When
> | someone says the following:
> |
> | "My Page_Load gets called twice on a button click postback"
> |
> | The replies are:
> |
> | "Do you have AutoEventWireup=True in your page header?"
> |
> | In my project, I have this set to false - everywhere.
> |
> | Also, if I keep repeating exactly the same button click action, over
> | and over again, sometimes the Page_Init and Page_Load gets called
> | twice, sometimes it just gets called once. It almost appears to be
> | random.
> |
> | More specifically, my aspx page contains several web user controls.
> | On one web user control I have the button in question, and it's when I
> | click this, that the Page_Init and Page_Load of another web user
> | control on the same aspx form either gets called once or twice.
> |
> | What should I do? Do you think something has got muddled up
> | internally, and I should delete some files and start again?
> |
> | Thank you,
> | Regards, dnw.


Dot net work 11-24-2004 08:04 PM

Re: Page_Load and Page_Init get called twice, sometimes!
 
I have solved my problem.

I created brand new aspx files, and re-dragged and dropped my existing
web user controls on to them, and now I no longer have the
Page_Init/Page_Load sub routines getting called twice.

-dnw.

"bruce barker" <nospam_brubar@safeco.com> wrote in message news:<efEEPJY0EHA.2788@TK2MSFTNGP15.phx.gbl>...
> look at the generated OnInit code, and you will see the event wireup. check
> for duplicate entries.
>
> -- bruce (sqlwork.com)
>
>
>
> "Dot net work" <dotnw@hotmail.com> wrote in message
> news:77b8c5a9.0411230104.5bd18464@posting.google.c om...
> | I've read quite a few threads on these groups about this. When
> | someone says the following:
> |
> | "My Page_Load gets called twice on a button click postback"
> |
> | The replies are:
> |
> | "Do you have AutoEventWireup=True in your page header?"
> |
> | In my project, I have this set to false - everywhere.
> |
> | Also, if I keep repeating exactly the same button click action, over
> | and over again, sometimes the Page_Init and Page_Load gets called
> | twice, sometimes it just gets called once. It almost appears to be
> | random.
> |
> | More specifically, my aspx page contains several web user controls.
> | On one web user control I have the button in question, and it's when I
> | click this, that the Page_Init and Page_Load of another web user
> | control on the same aspx form either gets called once or twice.
> |
> | What should I do? Do you think something has got muddled up
> | internally, and I should delete some files and start again?
> |
> | Thank you,
> | Regards, dnw.



All times are GMT. The time now is 06:44 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.