473,396 Members | 1,826 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,396 software developers and data experts.

Page_Load is called 12 times?

I just find out in a debug that Page_Load is called 12 times when rendering
the page.

What could be the problem?

All this page has is a bunch of UserConrols.

I did check the InitalizeComponent. It hooked up only once there and
AutoEventWireup="false"

Thanks.
George.
Nov 18 '05 #1
3 2084
I uncovered what is causing this.

I am calling the page with parameters as part of the URL.
like
http://www.mysite.com/mypage.aspx/param1/param2

This syntaxes is causing that Page_Load is called multiple times.
Not sure is it a bug or feature though.

George.
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:uK**************@TK2MSFTNGP11.phx.gbl...
I just find out in a debug that Page_Load is called 12 times when rendering the page.

What could be the problem?

All this page has is a bunch of UserConrols.

I did check the InitalizeComponent. It hooked up only once there and
AutoEventWireup="false"

Thanks.
George.

Nov 18 '05 #2
Sorry my bad.
Just discovered that page is using relative URLs to the images.
And when I am accessing
http://www.mysite.com/mypage.aspx/param1/param2
relative URL becomes http://www.mysite.com/mypage.aspx/param1/img/a.gif
And Basically IE hits mypage.aspx 12 times.

Thanks and sorry for jumping the gun too quick.
George.

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP10.phx.gbl...
I uncovered what is causing this.

I am calling the page with parameters as part of the URL.
like
http://www.mysite.com/mypage.aspx/param1/param2

This syntaxes is causing that Page_Load is called multiple times.
Not sure is it a bug or feature though.

George.

Nov 18 '05 #3
why use /param1/param2 (how do you do that anyway?) and make it think it's a
folder on the server?

why not use ...mypage.aspx?param1=something&param2=somethingel se&param3=...
as the URL?
Sorry my bad.
Just discovered that page is using relative URLs to the images.
And when I am accessing
http://www.mysite.com/mypage.aspx/param1/param2
relative URL becomes http://www.mysite.com/mypage.aspx/param1/img/a.gif
And Basically IE hits mypage.aspx 12 times.

Thanks and sorry for jumping the gun too quick.
George.

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP10.phx.gbl...
I uncovered what is causing this.

I am calling the page with parameters as part of the URL.
like
http://www.mysite.com/mypage.aspx/param1/param2

This syntaxes is causing that Page_Load is called multiple times.
Not sure is it a bug or feature though.

George.


Nov 18 '05 #4

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

Similar topics

2
by: magister | last post by:
Hello I have a default.aspx page with which has an iframe. In the code-behind of the default.aspx page it loads the 'src' attribute of the iframe. The iframe loads another aspx page, but...
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) {...
6
by: Olivier Matrot | last post by:
Hello, This has probably been asked several times, but It must be clarified for me. I would like to know why sometimes during a postback Page_Load is called after the function marked for...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
4
by: amitku | last post by:
I am working on a web site and whenever someone arrives at the home page, I'm trying to track this by inserting some values into my database. I do so from the Page_Load function. Unfortunately...
2
by: Regfellow | last post by:
Hi, Ive created a webform in asp.net. When the page is called the page_load event get called 2 times before the page is loaded. I remember i have had this problem now and then from the...
2
by: matt.grande | last post by:
I know this question has been asked on here before a few times, but none of those results suit my needs. Here's my situation. I have a search form. When I click the submit button, the query is...
9
by: coltrane | last post by:
I am just learing ASP.Net and my first app has a simple Page_Load that just sets a variable. This does not seem to be called. The following is a snippet of the page: <script runat="server"...
11
by: fiefie.niles | last post by:
I am using ASP.NET 2005 and I have a simple form. Page_Load calls a sub mySub that does not do anything (for testing purposes). But, Page_Load gets called twice. On every single ASPX page in my...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...

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.