Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page_load fires last on postback

Reply
Thread Tools

Page_load fires last on postback

 
 
choukrou@yahoo.fr
Guest
Posts: n/a
 
      11-06-2006
Hello everybody!

Got a nice problem on 1 of my aspx (and only one): It was working
"perfectly" for 1year and a half. Last week I had to fix a lil bug. I
do that and test my app. And on the fixed page, on the first load
everything is allright.

But on postback, it seems that the Page_load event is the last fired.
But in this event, obviously, i'm initializing some vars like my
connection string, to use in my others events and functions. So on the
first load my vars are ok and everything works, but on the postback,
when I call my connection string var on the MyDatagrid_ItemCreated and
it's empty, there's a little big error message...

My bugfix doesn't seems to be the source of the problem because:
I fix a function of me, I didn't touched anything else. And it's not a
function to launch a rocket for the N.A.S.A., just to access a DB and
return a string.

I took back my bugged page and replaced my fix by a thing like
if(true){} And the Page_load still fires after all others events on
postback.

I tried to modify another page, but everything works perfectly, the
page_load is always first.

Have u any idea to fix this problem? I searched the newsgroups, saw
like 2 messages with the same problem but nothing very helpfull to try.
Is that a problem between the chair and the keyboard, or something
else?

Thanks for your help by advance and scuse me for my English

 
Reply With Quote
 
 
 
 
Felix Piskunov
Guest
Posts: n/a
 
      11-06-2006
Try to use Page_PreInit (or Page_Init) instead of Page_Load.
It doesn't fix the problem with Page_Load, but it should solve your problem
widht access to DB


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hello everybody!
>
> Got a nice problem on 1 of my aspx (and only one): It was working
> "perfectly" for 1year and a half. Last week I had to fix a lil bug. I
> do that and test my app. And on the fixed page, on the first load
> everything is allright.
>
> But on postback, it seems that the Page_load event is the last fired.
> But in this event, obviously, i'm initializing some vars like my
> connection string, to use in my others events and functions. So on the
> first load my vars are ok and everything works, but on the postback,
> when I call my connection string var on the MyDatagrid_ItemCreated and
> it's empty, there's a little big error message...
>
> My bugfix doesn't seems to be the source of the problem because:
> I fix a function of me, I didn't touched anything else. And it's not a
> function to launch a rocket for the N.A.S.A., just to access a DB and
> return a string.
>
> I took back my bugged page and replaced my fix by a thing like
> if(true){} And the Page_load still fires after all others events on
> postback.
>
> I tried to modify another page, but everything works perfectly, the
> page_load is always first.
>
> Have u any idea to fix this problem? I searched the newsgroups, saw
> like 2 messages with the same problem but nothing very helpfull to try.
> Is that a problem between the chair and the keyboard, or something
> else?
>
> Thanks for your help by advance and scuse me for my English
>
>



 
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
Simple composite control fires event fires first time but not second sellars.paul@googlemail.com ASP .Net Web Controls 3 05-13-2009 03:19 PM
CodeBehind But Not Postback - Page_Load fires twice =?Utf-8?B?RXJpayBKZW5zZW4=?= ASP .Net 4 07-21-2005 08:16 PM
Page_Load Event Fires Twice When Sending Down a PDF Jay Douglas ASP .Net 7 01-10-2005 05:05 PM
Page_Load event fires twice in asp.net (C#) ? Jon ASP .Net 1 01-13-2004 02:49 PM
Page_Load fires twice H Branyan ASP .Net 0 10-22-2003 09:46 PM



Advertisments