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

Page constructed and processed twice!?

Hi,

I have a weird problem, which is quite hard to debug: An ascx-Control
seems to be constructed and processed twice. The AutoEventWireup
attribute is set to true. Looking at google, I found a lot of hints
about OnInit and Page_Load called twice. So I set AutoEventWireup to
false and connected the Page_Load event via code. And it's still
called twice!

Then I implemented a new default constructor and a boolean member
which has false as default value. In the ctor this member is set to
true. I have done this, to check if I really get two instances of the
page.

Setting a breakpoint into the ctor, I see that the page is
instantiated twice. So I think it must be another problem than the
AutoEventWireup one. Any hint what might be the reason for such a
behavior? I have no glue at all!

any hint would be very appreciated,

Achim
Dec 19 '07 #1
3 1211
Most likely you get 2 requests for that page from browser thus you are
getting your page instantiated twice.

Things to look for...
Image tag with empty or no src. Like <img src="" That would make browser
(some versions) to make a second GET call to your page.
And things like that.

George.
"Achim Domma" <do***@procoders.netwrote in message
news:b4**********************************@t1g2000p ra.googlegroups.com...
Hi,

I have a weird problem, which is quite hard to debug: An ascx-Control
seems to be constructed and processed twice. The AutoEventWireup
attribute is set to true. Looking at google, I found a lot of hints
about OnInit and Page_Load called twice. So I set AutoEventWireup to
false and connected the Page_Load event via code. And it's still
called twice!

Then I implemented a new default constructor and a boolean member
which has false as default value. In the ctor this member is set to
true. I have done this, to check if I really get two instances of the
page.

Setting a breakpoint into the ctor, I see that the page is
instantiated twice. So I think it must be another problem than the
AutoEventWireup one. Any hint what might be the reason for such a
behavior? I have no glue at all!

any hint would be very appreciated,

Achim

Dec 19 '07 #2
On 19 Dez., 19:41, "George Ter-Saakov" <gt-...@cardone.comwrote:
Most likely you get 2 requests for that page from browser thus you are
getting your page instantiated twice.

Things to look for...
Image tag with empty or no src. Like <img src="" That would make browser
(some versions) to make a second GET call to your page.
And things like that.
Thanks very much for that hint! Is it possible to get a log file for
the incomming request to the asp.net develoment server? After I read
your post, I checked the HttpMethod of the two calls to the page. The
first one is POST, the second one is GET. That matches your posting,
but then I should see the result of the POST in my browser. Or am I
wrong? And enabling asp.net trace output in my page, I can see that
the displayed page is the result of a GET request!? Any further hint?

regards,
Achim
Dec 20 '07 #3
Sorry, for the confusion. There was a redirect I didn't know about.
And a redirect - of course - causes a second GET request.

Achim
Dec 20 '07 #4

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

Similar topics

37
by: asj | last post by:
awhile back, eBay decided to switch from a Microsoft/.NET/Windows architecture on the backend to a J2EE one, which might explain why their java backend will handle up to 1 BILLION page views a day!...
7
by: Patrick Ruhnow | last post by:
Hello, i have an ASP Page that generates a PDF document. After the generation i save the generated document as a file. all works fine. the only strange thing is, that my document is stored...
1
by: bss2004 | last post by:
Hi- I have a couple of pages on my asp.net site that take a few minutes to process after the user clicks the submit button. An example is a page that kicks off a Crystal Report that is printing a...
2
by: Jon | last post by:
I am using the following code in a header, in a mixed C++ program: class C { public: C& I() { static C c; return c; } };
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
5
by: jonhyland | last post by:
Hey all, I'm writing a .NET application where I want all HTTP errors such as 404 to redirect back to the home page. Since .NET only handles HTTP errors if the client is requesting a .NET...
8
by: TS | last post by:
Hi, i have inherited a page from another user. The page is the target frame in a frameset. for some reason the whole page runs twice (page_load, init, etc. all run twice) I can't figure out how...
0
by: Graham Sibley | last post by:
Have any of you seen this behavior before: I have a path http://localhost/default.aspx, which is a page containing dynamic content that is displayed based on a querystring. The path can be...
1
by: Alan Samet | last post by:
I know what's causing this, but how do I work around it? ********************** file: test.master: ********************** <%@ Master %> <script runat=server> void Page_Load(object sender,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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,...
0
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...
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...

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.