Search

Jun 10, 2008

Some Weird/Good behaviour of Mozilla

I face one problem in Mozilla but with other browser it works fine.

The problem was like... the page get called twice!!! There is case when the server side code called twice, not client side.

After doing some good work found the solution, and was simpley good. The following line was causing the problem.

<asp:Image ID="imgTest" runat="Server" />

In first look you can see there is no problem with it. But there is still problem; the missing ImageUrl. Mozilla send request to current page asking for an image, which we havent set yet; as the value get assign from server side, by this reason the only server side code is get executed twice!!!!

Interesting, isn't it!!

So here is the solution:

<asp:Image ID="imgTest" runat="Server" ImageUrl="abc.jpg" />

4 comments:

chintanparmar said...

Good Shot man !, I am sure, hardly 5% of people knows about this.

LEO said...

technic..... grt ...:)

Chris said...

Incredible! Thank you for posting this solution. Instead of the bogus url though, I just set the image to visible=false until I set the url. Then it won't even send the tag to firefox until it is ready.

Anonymous said...

I am still not able to resolve it at my end. I do not have any control on my form. What do I do?