ASP.net reproducible bug

  • Thread starter Thread starter Ryan Folstad
  • Start date Start date
R

Ryan Folstad

I've seen a few posts from people wondering why OnInit fires multiple times
for one web form. I finally figured it out for my situation.

I tested this on both .net 1.1 and 1.0 both were able to reproduce.


Create a new c# web app. in WebApp1.aspx add the following html:
<table><tr><td background="#000000"></td></tr></table>

Place a Break in the Web designer generated OnInit.

Hit run..

OnInit will fire twice..

remove the background="#000000" and it will only fire once..

serious bug.. as the second time it fires the context is lost and the
request seems to be lost aswell..

Brilliant!

How would i go about reporting this to ms or getting a fix without using up
one of my msdn incidents?

R
 
You're using the background attribute wrong.
The baground attribute is to specify a background image.
Use the BGColor attribute to specify the background color.
Here's more info:
http://www.blooberry.com/indexdot/html/tagpages/b/body.htm

But I agree with you that it still shouldn't cause the page to load twice,
so there is a bug for you to fix and a bug for Microsoft to fix.
 
You might try sending an email to (e-mail address removed) using Visual Studio
..NET in the title.
 
Microsoft will get this Bug Report very soon.

I am sure someone in this group will bubble this bug up the ladder.
 
I was only able to reproduce using:
Response.Redirect or link (<a href>)

If you use Server.Transfer to load the page its not reproducible. This is
what was really giving me a hard time tracking it down!

Hope this helps,

Ryan

Ryan,

I was only able to reproduce this bug only on postback in Both C# and VB.NET
and not on the initial load of the page. Do you see the same thing?

At least not a handicap.
That is Brilliant Ryan. Thank you for sharing this with us

SA
 
Thank you for the info

Ryan Folstad said:
To clarify.

It is only reproducible on initial load, if the page is loaded from a url or
response.redirect. Server.Transfer is ok.

However regardless how it was loaded initially any subsequent PostBack will
call OnInit twice.

I also noticed that the second OnInit has old Request information and
Context is gone.

R
 
Back
Top