c# - How to Force WebBrowser Control to use New Session or clear sessions -


in application, user open multiple tabs clicking on menus. each tab dynamically created , containing webbrowser control load url.

each url point same server , of url not have access , gives resource not have access error received.

now, problem is, example- if user directly click on menu3 , related tab loaded webbrowser url , follow next, url contain other popup link works , able popup url.

now, user click on menu5 not have access so, error resource not have access (denied server). fine. now, again url reach tomenu3and try open sub link popup dialog gives403 forbidden error- decline access`. works but, later giving error.

as looks, need clear webbrowser control cache or forcely start new session.

can 1 please guide me how force webbrowser start new session or remove earlier caches ?

the cache of webbrowser control same of internet explorer. have various options:

1) clear cache (will clear internet explorer!):

https://stackoverflow.com/a/24401521/2633161

2) use tags in server response:

<meta http-equiv="cache-control" content="no-cache"> 

3) use random query string force refresh:

webbrowser1.navigate('http://www.example.com/?refresh=' & guid.newguid().tostring()) 

4) force refresh of page (this load page 2 times!):

webbrowser1.navigate('http://www.example.com/') webbrowser1.refresh(webbrowserrefreshoption.completly) 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -