Hi Asa,
Thanks for your followup. I think you've excatly found the cause and after
some futher test, here are my understanding on the reason of this behavior:
1. First the <body> 's "background" attribute should be set with a url
value since its for settintg the page's background image rather than
background color :)
2. Then, when you set the "background" as a web color value such as
#XXXXXX, the web browser will treat the "#XXXXXX" as a url. As we know, the
#XXXXXX is are particular link type( anchor) which point to the self page's
certain portion. That makes the browser send another get request when
parsing to the <body background="#xxxxxx" > line.
Also, you can make a same test via the following page code:
<body>
<img src="#" />
.....
</body>
This will also cause the self page be requested twice. But this only occurs
when the page is posted back rather than the inital request, the reason is
in 3.
3. The IE browser will treat the GET and POST request to a single url as
different request. When the page is first time requested( not post back),
it send a get request, and the page return, and when parsing to the <body
background="#xxxxxx" >, it won't send a new GET request because it has done
it already.
However, when post back, since post back reqeust is a POST request, IE
browser think it is different from the GET request, so he will send another
GET request when dealing with the <body background="#xxxxxx">
Anyway, I'm glad that we finally figure out the problem. And it maybe a
good instruction when next time we meet such problem. :)
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx