Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Page constructed and processed twice!?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Achim Domma - 19 Dec 2007 18:23 GMT
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
George Ter-Saakov - 19 Dec 2007 18:41 GMT
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.

> Hi,
>
[quoted text clipped - 18 lines]
>
> Achim
Achim Domma - 20 Dec 2007 09:59 GMT
> Most likely you get 2 requests for that page from browser thus you are
> getting your page instantiated twice.
[quoted text clipped - 3 lines]
> (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
Achim Domma - 20 Dec 2007 10:39 GMT
Sorry, for the confusion. There was a redirect I didn't know about.
And a redirect - of course - causes a second GET request.

Achim

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.