I found a bug in the framework 3.5

  • Thread starter Mike Gleason jr Couturier
  • Start date
M

Mike Gleason jr Couturier

-------------------------------------
Microsoft Visual Studio 2008
Version 9.0.21022.8 RTM
Microsoft .NET Framework
Version 3.5
Installed Edition: Professional
-------------------------------------

Unless someone @Microsoft tells me "this behavior is by design":

Just put an asp:Image tag without an ImageUrl attribute on a blank page of a
new project and be prepared for a mighty double postback... Plus, your
buttons handles might be screwed.

Spent too much time on this one... on a thight deadline :(

(What's annoying is that I followed a code example for the Collapse Panel
extender on the ASP.net website)

Mike
 
G

George

It's not a ASP.NET bug, it's how browser works....
if you do not put ImageUrl then ASP.NET generates following HTML.

<img src="">
Browser trying to resolve the image path and resolves it to the same url as
your aspx page. And then it requests an image. Hence you get second request
for the page....

PS: I recall only IE does that. FireFox does not resolve the empty src to
the page URL (or may be it's only FireFox does and IE does not).

PPS: As far as i know all versions of ASP.NET do that. Not only 3.5

George.
 
M

Mike Gleason jr Couturier

George said:
It's not a ASP.NET bug, it's how browser works....
if you do not put ImageUrl then ASP.NET generates following HTML.

<img src="">
Browser trying to resolve the image path and resolves it to the same url
as your aspx page. And then it requests an image. Hence you get second
request for the page....

PS: I recall only IE does that. FireFox does not resolve the empty src to
the page URL (or may be it's only FireFox does and IE does not).

PPS: As far as i know all versions of ASP.NET do that. Not only 3.5


That makes sense.... in fact, this behavior IS by design :D
Codeplex should take this in account in their examples :)

Thanks for your clear explanations!!

Mike
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top