I'm having trouble my application which is supposed to write text in some textboxes on a website and click OK button. But then the problem comes, the site loads a new page and you have to confirm the previous commands by clicking a new OK button. What I need help with is for my C# code to execute the commands as they are called and no do them once the running thread is dead.
Example of my code:
private void startScript_Click(object sender, EventArgs e)
{
webBrowser1.Document.GetElementById("login_box").InnerText = "NAME";
webBrowser1.Document.GetElementById("password_box").InnerText = "PASS";
webBrowser1.Document.GetElementById("login_button").InvokeMember("click");
//This is where i want the first texts and click to be submitted so it then
//can click on the confirm button the the next page
webBrowser1.Document.GetElementById("confirm_login").InvokeMember("click");
//Submit the confirm click
} //This is where all the information given in the code is actually given/executed to the browser
So to clear up the question. What I need to do is; give the information to the browser directly when the webBrowser1.Document...; is called. A command to submit would also work (webBrowser1.SubmitData) or something like that.