Hi, I need some help with this control.
There's a windows form with a axwebbrowser control inside, so users can
navigate to a page and it's necessary to keep the session, because,
users will access many times to this site and don't want to log in each
time. The process is the following: the form is shown and user
navigate through the webbrowser control, the form can be closed and
opened many times but the session of the page referenced needs being
mantained.
That is why the form is static, the problem becomes whit the Navigate
method. The first time it works well and gets the site referenced, but
if this method is invoked again then an exception is thrown: "The
requested resource is in use".
If I detect that Navigate method was invoked (viewing the value
retrieved by the LocationURL property of the axwebbrowser control), I
can put a condition and then not to call this method, but then nothing
is shown in the browser.
the code is like this:
oURL="http://localhost/Default.aspx"; /* any valid URL */
object oEmpty = System.Reflection.Missing.Value;
if (this.axWebBrowser1.LocationURL.Equals(String.Empt y))
{
axWebBrowser1.CtlRefresh();
//axWebBrowser1.Refresh();
}
else
{
this.axWebBrowser1.Navigate(oURL,ref oEmpty,ref oEmpty,ref
oEmpty,ref oEmpty);
} }
I've tried with axWebBrowser1.CtlRefresh() and axWebBrowser1.Refresh()
methods but nothing is viewed in the control.
The form is shown by a ShowDialog() or by a Show(), in the second case
it's necesary to Hide the form before.
any help will be appreciate.
Thanks in advance.