I hope this isn’t a stupid question. However I am writing a program at the moment which is a front end for a website booking system.
When I navigate to a specific link it remembers previous information on the page – So I have to make it load the page and then refresh – It’s a bit messy doing this, so I have created another form which comes up during the loading called pleasew.cs. It will show “pleasew” for the first while loop and then I am assuming that “WebBrowserReadyState” is set to “Complete.” and it more or less then closes the “pleasew” form before it’s completed the refresh. Is there anything I can do to reset “WebBrowserReadyState” before it refreshes? Or is there another solution at all?
Many Thanks for looking
Here is the code:
private void button7_Click_1(object sender, EventArgs e)
{
webBrowser1.Navigate("www.test.co.uk");
pleasew pleasewait = new pleasew();
pleasewait.Show();
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
webBrowser1.Refresh();
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
pleasewait.Hide();
}
If I understand your problem right, you beleive the readystate doesn’t get out of complete status when you do your refresh. Have you debugged to be certain it never enters the second while loop? Maybe because it’s a refresh, it loads up from the cache, and that’s the source of your confusion.
Try doing a second Navigate instead of Refresh and see what happens.