473,594 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Page_Load events firing

I've searched several discussions on this topic and haven't been able
to resolve my issue. I have a function I call within the page_load
event of a page. This function makes a call to the database to
retrieve data. While I was doing performance review of the site, my
sql profiler showed that query being executed multiple times for a
single page load.

I'm using several web user controls on the pages, none of which call
this function. I've checked to make sure that the
AutoEventWireup ="false" on the page. It appears the number of repetive
calls is related to the number of controls on my page; the more the
controls the more times it executes the Page_Load.

Can anyone provide any clues about this problem? It doesn't impact the
functionality of the pages, but I don't want to burn up excess
resources. Thanks.

Jan 28 '06 #1
3 1662
Can you post "Short but Complete" example code that will enable somebody to
replicate this issue?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ge******@aol.c om" wrote:
I've searched several discussions on this topic and haven't been able
to resolve my issue. I have a function I call within the page_load
event of a page. This function makes a call to the database to
retrieve data. While I was doing performance review of the site, my
sql profiler showed that query being executed multiple times for a
single page load.

I'm using several web user controls on the pages, none of which call
this function. I've checked to make sure that the
AutoEventWireup ="false" on the page. It appears the number of repetive
calls is related to the number of controls on my page; the more the
controls the more times it executes the Page_Load.

Can anyone provide any clues about this problem? It doesn't impact the
functionality of the pages, but I don't want to burn up excess
resources. Thanks.

Jan 29 '06 #2
Peter-

Thanks for your willingness to assist, but as it turns out, while I was
trying to pair down some of the code in order to show you what's going
on, I found that the function I'm calling makes a recursive call to
itself in some circumstances.. .sometimes it's the obvious things that
are the most obscure.

Thanks,
Greg

Jan 30 '06 #3
Exactly! Often during the process of preparing a code sample, we find the
issue ourselves.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ge******@aol.c om" wrote:
Peter-

Thanks for your willingness to assist, but as it turns out, while I was
trying to pair down some of the code in order to show you what's going
on, I found that the function I'm calling makes a recursive call to
itself in some circumstances.. .sometimes it's the obvious things that
are the most obscure.

Thanks,
Greg

Jan 30 '06 #4

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

Similar topics

5
7331
by: Adam Clauss | last post by:
I have a webapp which consists of several different webforms. Basically: (1) view the contents of a database (2) one is to add a new entry (3) confirms the new entry. The third form, upon confirming the entry (in a button_clicked handler) adds the entry into the database and then redirects back to (2) using Response.Redirect(..)
7
2340
by: Shane Bishop | last post by:
I've been fighting with the Page_Load event firing twice. I looked through this user group and saw several other people having similar problems. There were various reasons for it: AutoEventWireup="true" instead of AutoEventWireup="false" Spyware software And having your events all wired wrong I had done everything to my machine, stripped it down to just have ..NET on it and I was still having this problem until...
2
2211
by: Dave | last post by:
Hi, this is a follow-up to an earlier question but I really haven't found a definitive answer in my search If I have a Base and Derived webform, I've found that the dervived Page_Load event fires first, then the base Page_Load. Is the only technique to change this sequence is to override the Base.Page_Load and explicitely call the base event when you want to as below: Derived WebForm
4
3964
by: Seraph | last post by:
Again, I'm rather new here, so if I fail to follow any etiquette, please forgive me and let me know what I've done wrong, but I think this might interest quite a few people. One of my colleaques was endeavoring to create a custom user control to make things a bit simpler, but she noticed that her Page_Load eventhandler was firing twice. So after long hours of research and experimentation, I stumbled upon, imho, is quite the discovery. ...
1
3113
by: Ahmet Gunes | last post by:
Hi all, I check whether session is alive in Page_Load. If session is not alive then I want to navigate to another page, most probably the login page. But when a control, a button for example, is clicked, after Page_Load the button's click event is also fired. Since session is abandoned at this moment, any object references raise
3
1852
by: Steve Wonderful | last post by:
I would like to know how to catch the code after the end of the Page_Load event. I found something not to my expection after the Page_Load. It is when I hit the ENTER key when it post back. It goes to Page_Load, when it reaches the end of the event, I could not trace any more. I don't know where it goes. Can you tell me how do I catch what happening after it?
4
1185
by: DazedAndConfused | last post by:
How can I prevent subsequent events from firing when I have an error in the page_load event?
9
3176
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will load with different data (locations, departments, etc.).
1
1830
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 Value is left blank. Both are set in the Page_Load (myODS.SelectParameters.DefaultValue = 999) I put Debug statements in the Page_Load, ODS_Load and method of my
0
7947
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7880
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8255
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8010
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8242
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6665
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.