deanlee17
asked on
Order code executes
Hi guys,
I have the following on 2 different button clicks:
Button1:
Button2:
This all works fine. But when I combine the 2 into a 'loaded' grid event the login never occurs. Why do they work separately on buttons but not when combined? Is it the order the code is executing?
Thanks,
Dean
I have the following on 2 different button clicks:
Button1:
WebBrowser_Sourcing_BrokerForum_Enquiry.Navigate(new Uri(" http://www.brokerforum.com/iris-parts-search.authenticated-en.jsa"));
Button2:
try
{
var htmlDoc1 = (HTMLDocument)WebBrowser_Sourcing_BrokerForum_Enquiry.Document;
var UsernameTextBox = (mshtml.HTMLInputElement)htmlDoc1.all.item("Session_Username", 0);
UsernameTextBox.value = "XXXX";
var PasswordTextBox = (mshtml.HTMLInputElement)htmlDoc1.all.item("Session_Password", 0);
PasswordTextBox.value = "XXXX";
foreach (mshtml.HTMLInputElement HTMLI in ((mshtml.HTMLDocument)WebBrowser_Sourcing_BrokerForum_Enquiry.Document).getElementsByTagName("input"))
{
if (HTMLI.getAttribute("type").Equals("image"))
{
if (HTMLI.src == "http://www.brokerforum.com/tbf/img/login-button-en.png")
{
HTMLI.click();
return;
}
}
}
}
catch (Exception) { }
This all works fine. But when I combine the 2 into a 'loaded' grid event the login never occurs. Why do they work separately on buttons but not when combined? Is it the order the code is executing?
Thanks,
Dean
ASKER
It does indeed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nice idea, but it doesn't change anything.
Set up a breakpoint, and see if they even get called in the first place