Page constructed and processed twice!?

A

Achim Domma

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
 
G

George Ter-Saakov

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.
 
A

Achim Domma

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
 
A

Achim Domma

Sorry, for the confusion. There was a redirect I didn't know about.
And a redirect - of course - causes a second GET request.

Achim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top