tags:

views:

279

answers:

1

Hi. How can we refresh a WebBrowser from a winform?

I tried this:

mymethod()
{
    WebBrowser wbmessages = new WebBrowser();
    Uri myuri = new Uri("http://mysite/message.aspx);
    wbmessages.Url = myuri;
    mypanel.Controls.Add(wbmessages);
}

I'm calling this mymethod every 10 seconds with a time ticker event.

In my http://mysite/message.aspx page load event I've printed a unique value like this:

System.Guid gid = System.Guid.NewGuid();
Response.Write(gid.ToString());

but every time it is showing the same value. What is the problem with this?

Thank you.

A: 

So you are creating a brand new WebBrowser control every 10 seconds? Sounds like it would quickly consume lots of resources.

Better to keep a reference to your existing control, and simply call the Refresh method on it.

Mattias S
Even i call the method it is not getting refreshed.. waht is the problem
Nagu