views:

58

answers:

5

I need to refresh browser via c# code and google keeps silence. Any help would be very appreciated.

A: 

Consult your browser's documentation for exposed APIs that may allow you to refresh the browser page from a different application, then perform whatever appropriate interop is required to refresh the page.

Greg D
But he needs code in C#, right?
Kira
A: 

So, you can't do it with C#, because C# isn't used on the browser. You can do it through JavaScript though.

<!-- Codes by Quackit.com -->
<a href="javascript:location.reload(true)">Refresh this page</a>

http://www.quackit.com/javascript/javascript_refresh_page.cfm

or: Meta refresh Tag

If you wanted to split hairs, you could technically, do it in silverlight, but that really just ends up calling JavaScript:

http://stackoverflow.com/questions/552756/can-silverlight-initiate-page-refreshes

Kevin
A: 
Response.Redirect("the_page_you_want_to_refresh.aspx");
Flakron Bytyqi
It's not asp.net question.
er-v
A: 

This link talk about the "WebBrowser.Refresh" method... maybe it helps:

http://msdn.microsoft.com/en-us/library/txewax99.aspx

Kira
A: 

The awful, round about way to do it is to attach WatiN to the process (find the HWND, attach that way, most likely) and call Browser.Refresh().

Ian P