Dan Vogel
Dan Vogel

Reputation: 3938

Empty display after refresh on WebBrowser control

I have a WebBrowser control and using NavigateToString to display content. After the call to NavigateToString everything is loaded properly and looks great. However if F5 is pressed the display becomes empty.

How can I allow refresh, but reload the content?

Upvotes: 3

Views: 2264

Answers (1)

noseratio
noseratio

Reputation: 61666

That's because there is no URL to reload. More precisely, I'd expect the URL to be about:blank when using NavigateToString. Check browser.Document.URL to verify that. You may want to create a temporary file and navigate to it instead.

[EDITED] Indeed, ((dynamic)webBrowser.Document).URL is about:blank after NavigateToString, so you're reloading a blank page.

Upvotes: 3

Related Questions