473,383 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Page_load fires last on postback

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

Nov 6 '06 #1
1 1296
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
<ch******@yahoo.frwrote in message
news:11**********************@k70g2000cwa.googlegr 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


Nov 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: z. f. | last post by:
Hi, i have a class that is derived from System.Web.UI.Page, and this is the class i use in my application as PageBase. all other page classes are deriverd from my PageBase instead of the...
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
3
by: doobdave | last post by:
Hi all, I'm experiencing a rather strange problem: I am coding a web application using VB.net ASP.net and Visual Studio 2003. It's quite a large application, but the problem only occurs on...
4
by: Erik Jensen | last post by:
Hello All, I am trying a non-standard approace to asp.net that i hope will work so I can get an xhtml complient page. Setup as Follows: Code-behind but not form runat="server" so traditional...
12
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
2
by: John Dalberg | last post by:
I need to know what happens after Page_load has finished so I put a breakpoint at the last statement. However after stepping into after this last statement, the app continues running without the...
6
by: ad | last post by:
Hi, What is the difference between Page_init and Page_Load event?
6
by: dwclark | last post by:
I am having an issue when I trigger a Response.Redirect, the Page_Load fires on the page where the Response.Redirect was called. From what I've read, this should not happen and the browser should...
1
by: =?Utf-8?B?TWlrZXkgQmFieQ==?= | last post by:
Greetings Hopefully, I can be clear and concise on this one, but I'm confused. I have a page with a ListBox <- ODS <- BusinessObject and a button. The Parameter Source is 'None'. The Default...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.