This question is an exact duplicate of:
PLEASE DO NOT MATK AS DUPLICATE. I CHECKED THE OTHER URLS and THEY DID NOT RESOLVE THE ISSUE. IF THE BUILTIN CONTROL IS NOT ADEQUATE OR THERE IS NO FIX, PLEASE LET ME KNOW OF ALTERNATE CONTROLS OR IF WPF WILL RESOLVE IT
Already checked
WebBrowser DocumentCompleted event fired more than once
I have a button that has the following code
webbrowser1.Navigate(testURL);
In my event handler
private void webbrowser1_Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
Console.WriteLine("Now it is really done");
MessageBox.Show("Loaded " + psyncBrowser.Url);
webbrowser1.Stop();
}
I've also tried using Navigated and same results
private void webbrowser1_Browser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
Console.WriteLine("Now it is really done");
MessageBox.Show("Loaded " + psyncBrowser.Url);
webbrowser1.Stop();
}
The console message is printed out four similar URL's
Loaded Page https://server1/default/psq.exe?stuff=notdone Now it is really done Loaded Page https://server1/default/psq.exe?stuff=notdone# Now it is really done Loaded Page https://server1/default/psq.exe?stuff=notdone#1 Now it is really done Loaded Page https://server1/default/psq.exe?stuff=notdone#2
As you can see the only difference between the URL is #, #1, #2
When I click an element (via code), I get 4 URL's and all look similar (except the last 1-2 characters)
HtmlElement.InvokeMember("Click");
What's happening, and how can I stop this?
I looked at that link before and it did not address my concern.
The site I am trying to use does not have any FRAMES or IFRAMES. I checked the HTML several times.
FUll HTML of Page below
<!DOCTYPE html>
<html>
<head>
<title>Hitachi ID Identity and Access Management Suite: Verify password</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<meta http-equiv="cache-control" content="private,no-cache,no-store,maxage=0,s-maxage=0,must-revalidate,proxy-revalidate,no-transform">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript">
// <![CDATA[
// Array of fields to process and attempt to focus on page load
document.focusFields = [ "_MYPW", null ];
// ]]>
</script>
<link rel="stylesheet" type="text/css" media="all" href="docs/default/css/style.css?3242224743"><!--[if lte IE 8]><link rel="stylesheet" type="text/css" media="all" href="docs/default/css/style-ie8.css?3242224743" /><![endif]-->
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" media="all" href="docs/default/css/style-ie7.css?3242224743" /><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="all" href="docs/default/css/style-ie6.css?3242224743" /><![endif]-->
<script src="docs/default/js/en-US/lang.js?3242224743" type="text/javascript">
</script>
<script id="C_AUTHCHAIN_LOGIN:default:en-US:" src="docs/default/js/scripts.js?3242224743" type="text/javascript">
</script>
</head>
<body class="default noSide">
<a name="top" id="top"></a>
<form name="theform" method="post" action="psf.exe" autocomplete="off" id="theform">
<div id="container">
<span id="topMargin"><input id="TRANSACTION" name="TRANSACTION" type="hidden" value="C_AUTHCHAIN_LOGIN"> <!-- 81A84EBD-2CE5-4794-8341-E1828711FFBC -->
<input id="SESSDATA" name="SESSDATA" type="hidden" value="{AES}EIDgCtlm1WIHTuwgStamCgi1cvi98CgOIhXUvVy7N2o3jDv6ce5qxqTFLdgzyU+QYBoq5w064mzb174I2rLVeq1HT8Z+hzi78gSMPbDzX0CBy0/GVTAfFsXk4OR6hc/e"> <input id="SESSLENGTH" name="SESSLENGTH" type="hidden" value="600"> <input id="SKIN" name="SKIN" type="hidden" value="default"> <input id="LANG" name="LANG" type="hidden" value="en-US"> <input id="JS" name="JS" type="hidden" value="false"> <input disabled="disabled" id="currentDateTime" type="hidden" value="2015-04-22 08:05:08 "> <input alt="" class="hideIfJs" id="DEFAULT_PAGE_ACTION" name="DEFAULT_UNUSED_BUTTON.x" src="docs/pics/spacer.gif" style="border: none; height: 1px; width: 1px;" tabindex="1000" title="" type="submit"> <span id="skipNav"><a href="#topMenu">skip to main navigation</a> | <a href="#sideMenu">skip to side navigation</a> | <a href="#content">skip to main content</a></span> <!-- end #skipNav --></span><!-- end #topMargin -->
<div id="headerContainer">
<div id="header">
<div id="companyLogo">
<img src="docs/pics/company_logo.png" width="103" height="17" alt="Hitachi">
<div class="line"></div>
</div>
<div id="topButtons">
<ul>
<li><input class="submit submitIcon back" name="SUBMIT-BACK.x" title="Back" type="submit" value=""></li>
<li class="inactive"><input class="submit inactiveIcon home" disabled="disabled" name="SUBMIT-HOME.x" title="Main menu (Disabled)" type="submit" value=""></li>
<li class="inactive"><input class="submit inactiveIcon refresh" disabled="disabled" name="SUBMIT-REFRESH.x" title="Refresh (Disabled)" type="submit" value=""></li>
<li><input class="submit submitIcon logout" name="SUBMIT-LOGOUT.x" title="Logout" type="submit" value=""></li>
</ul>
</div><!-- end #topButtons -->
<div id="topMenuBar">
<div class="clearFloat"></div>
</div><!-- end #topMenuBar -->
</div><!-- end #header -->
<div id="userInfo">
<img src="docs/pics/icon_idcard.png" alt="ID" width="16" height="12"> ID: username <img src="docs/pics/icon_user.png" alt="User" width="10" height="14"> Name: Person Name
</div>
</div><!-- end #headerContainer -->
<div id="contentScroll">
<table cellspacing="0" id="colWrap">
<tbody>
<tr>
<td id="menuCol">
<div id="menuContent"></div><!-- end #menuContent -->
</td><!-- end #menuCol -->
<td id="mainCol">
<div id="content">
<h1>Verify password <span class="selectedObj"></span></h1><br>
<input type="hidden" name="LANG" value="en-US"><input type="hidden" name="SKIN" value="default"> <span class="bold">Enter password:</span>
<table cellspacing="0" class="border">
<tbody>
<tr>
<td class="prompt" width="50%"><span>Enter password for AD:</span></td>
<td width="50%"><input class="password text" maxlength="250" name="_MYPW" type="password"></td>
</tr>
<tr class="foot">
<td colspan="2"><input class="submit" name="SUBMIT-VERIFY.x" type="submit" value="Verify password"></td>
</tr>
</tbody>
</table><input type="hidden" name="SETTABLEFIELDSDB" value=""> <input type="hidden" name="SETTABLEFIELDSCOOKIE" value="">
</div><!-- end #content -->
</td><!-- end #mainCol -->
</tr>
</tbody>
</table><!-- end #colWrap -->
</div><!-- end #contentScroll -->
<div id="footer">
<div id="footerCompany">
Company Name
</div>
<div id="footerVersion">
<b>Hitachi ID Identity and Access Management Suite</b> v8.2.7.60749
</div>
<div id="footerCopyright">
<div>
<sup> </sup>© 2014 <a id="footerLink" href="http://Hitachi-ID.com" rel="external" target="_blank">Hitachi ID Systems, Inc.</a>
</div>
</div>
</div>
</div><!-- end #container -->
</form>
</body>
</html>
It could be some JavaScript timer but not sure. If it is, how can I prevent it from launching or opening URL's that are not ending with #, #1, #2
I am using HTMLAgilityPack to navigate the page.
Did you do a fiddler trace of all the browser traffic that is happening from the point you do the navigate? I think if you do you will find that the first request is the "real" one, and that the next 3 requests are actually a result of attempts by the browser to download the favicon.ico file, but your server is configured to blindly issue a redirect back to the psq.exe file instead of returning 404. The resulting responses end up being discarded by the browser, but they still create load on your server, fill up your log files and are basically garbage.
RépondreSupprimerThe solution is to put a favicon.ico file on your server!
If true,