views:

37

answers:

2

I have a webBrowser Control. HTML inside webBrowser control displays some small images (4kb each). However when I run my application, Images are not loaded in to webBrowser Control. Also I have used javascript function to keep refreshing page at some interval.

 function StartTimer(MS){ 
TimerObj = setTimeout("window.location.href=window.location.href;",MS); 
                }

and calling this onload.

<body onload="StartTimer(10000);">

Moreover, If I press Ctrl+N, it opens same page in external IE browser. all images are displyed properly there. Once I do this step and then after, when webBrowser Control refresh page all images are displayed on WebBrowser Control as well. It seems, when I press Ctrl+N IE download images and WebBrowser Control is taking it from cache. But I want it to display at first time.

Any help is appreciated.

Thank You.

A: 

I hate to ask but are you navigating to the URL in code using something like this?

MyBroswer.Navigate(new Uri(@"http://someaddress.com));
kyndigs
Thanks for your reply kyndigs. I am dynamically setting URi property as belwo. WbOutstandingQ.Url = new Uri(StrUrl);
Akie
A: 

Solved.. Problem was URL. Actually the flow was like this. First time I was making request to server along with InstanceID in queryString. My web server were removing InstanceID while sending response. Any subsequent request without InstanceID to server will get failed.

Moral of the story: (Reason for confusing scenario, where images were not displayed inside webBrowser control but it were displayed in IE when I pressed Ctrl+N) : According to my understanding (Correct me if I am wrong) when client request for a page to web server, first web server respond with html content. client browser will display html content and if content has tag, browser first check images in cache. if it found inside cache it will display otherwise it will make another request to server to get images. In my case, second request was made by changed url and hence, it got failed. (May be its nature of only webBrowser control.) however IE works fine. Perhaps IE was using initial URL for all subsequent requests. Appreciate if someone add their comment on this if I am wrong and make me clear.

Thank You.

Akie