Skip to main content

What an empty src translates to!!!!

Yesternight, while trying to debug a bug logged against our ASP.NET code, we crashed into a wierd problem.

The scenario of the problem was:
- We had an ASP.NET page. When opened in IE, the page seemed to be executing fine. But loading this in FireFox (both versions 2 and 3b2), resulted in the ASP.NET Page lifecycle (OnInit,etc.etc.) being called twice.

We then used tcptrace (a tool similar to Fiddler. We were unable to get Fiddler working for FireFox, even after using the Pac file). We found that every postback resulted in the page being requested twice. One was a POST request (PostBack). The other was a GET request. Our immediate assumption was that ajaxcontroltoolkit must be trying to do some GET request only for FireFox browsers. Further analsysis cancelled this out, 'cos we realized that even IE was sending a request.

But there was a difference:
- IE was sending the request to the directory hosting the page
- FireFox was sending the request to the page to which the PostBack had to occur.

Then we misassumed that we had some JavaScript requesting for the same page again. But what irritated us was as to why IE and FireFox would behave differently for this JavaScript code? SO we had to rule out the option of JavaScript.

Taking a break at this point of time, helped.... And thought processes kicked in.. We put 2 plus 2 together and luckily hit on the correct number 4....

We opened the HTML source of the page, and started checking the href and src for every element on the page. We were unsure what we searching for, but for some reason were pretty sure that the problem was with SRC or HREF attribute of some tag.We stumbled on an img tag with a src="" (empty string). This looked pretty suspicious, and so one of us immediately created a sample page. Having nothing other than an img with src="". And managed to simulate the exact same problem.

So returning back to our original ASP.NET code, we found the location where the code was setting the ImageUrl to string.Empty, and changed it to "#". (Before you shout at me for stupiditiy, we are actually setting the image thru CSS background). And finally the page started behaving as all good ASP.NET pages should!!!

So 6 hours of debugging, taught us one more difference between the behaviours of FireFox and IE.
- "In case we host a page http://server/Directory/Page, and in the Page we have a src or href attribute with an empty string, FireFox will place a GET request for Page and IE will request for Directory"!!!!

Life in the web world is wierd, isn't it!!!!

Comments

Popular posts from this blog

The fight is in the open

Been busy lately and so have not managed to post for quite long. But I just had to post this. This post is dedicated to all persons who dont know anything about the fight between MS and Google: Check out the links starting from: http://news.zdnet.com/2100-9588_22-5875433.html?tag=nl.e589 There are more links as you get thru the article. Be sure to read those too. And just as a side-note: Check out " Atlas ". These are client side and server side components, which easily (??) enable you to make Web calls. This is done by encapsulating AJAX. (please dont insult by telling me that you dont know what that is).

Finally decided

I have been having these various itch since quite some time. Both about what i am doing here (where i work) and what am i meant to do. Finally, i have decided "I need a job change". I guess IT services industry was never meant to be the right industry for me. Don't get me wrong there, it's not that i wanna quit because i am not getting any interesting work, it's just that I have ideas about life which does not match with what my company is doing. (As amatter of fact, they have some really beautiful concepts which are great to work on). But i have believed web to be the future and now i have started realising that personal dreams do become quite a pain in the neck, when they are ignoired. Huh.... now that i put it on a log, i feel much better. Back to work...

Imagine...an internet based world

Was reading "The Google Story", when i got this wierd idea. Consider a stripped down version of Linux, meant only for doing simple things such as browsing the internet, to read from the various drives (which is primarily meant only for storage of personal data), to play music and some single-player games. All the rest provided by the internet. Information searching/Chatting/Mailing/Documentation editing/journal maintenance/daily schedule maintenance/news/rss/shopping, etc. What else will you use for your computer for? Ok, actually i have been working on mainframes for some time now and am getting adjusted to the "dumb terminal" concept. Then i started associating the concept with scenario we are observing all over the net. As a matter of fact this will reduce the power of processing required on the client side also!!! Looks like the world is changing.... for the bettter, yup, i am sure. technorati tags: New internet age , dumb terminal , internet based world