c#.net Webbrowser 控件锚标记调用单击事件不适用于备用行
我正在使用 c#.net 和 webbrowsercontrol。 我正在调用锚标记的点击事件。
应用程序具有以下代码:
HtmlElementCollection anchors = browser.Document.GetElementsByTagName("a");
foreach (HtmlElement anc in anchors)
{
if(anc.GetAttribute("href").ToLower().Contains("javascript:PFA".ToLower())
{
anc.InvokeMember("click");
}
}
它适用于一行,不适用于另一行。
来源网站有以下:
<td colspan="1" id="tdborder" align="left" width="5%">
<input name="appsWithStatusChg" type="checkbox" id="appsWithStatusChg1" alt='checkBoxLabel1'
label='checkBoxLabel1'
value="12114831" >
</td>
<td width="10%">
<a class="PairLink" tabindex="17" href="javascript:postForApplicationData('12114831')">
12/114,831
</td>
<td width="10%"> -</td>
<td width="14%"> US 2008-0209452 A1</td>
<td width="14%"> 1133-112US02</td>
<td width="11%"> 98449</td>
<td width="9%"> 12-24-2011</td>
<td width="17%"> 05-05-2008</td>
<td width="8%">
<!--<input type="button" name="submitForIFW" value="Review" id="submitForIFW" onClick="postForIFWData('12114831')" tabindex="9" >
-->
<a href="javascript:postForIFWData('12114831')" tabindex="9"> View</a>
</td>
</tr>
问题是当我们尝试调用点击事件时 对于 tr 为 wpsTableShdRow 的锚标记不起作用。 tr 为 wpsTableNrmRow 的锚标记正在工作。
当我们尝试手动访问单击事件时,它会起作用。
I am using c#.net and webbrowsercontrol.
I am invoking click event of anchor tag.
Application has following code:
HtmlElementCollection anchors = browser.Document.GetElementsByTagName("a");
foreach (HtmlElement anc in anchors)
{
if(anc.GetAttribute("href").ToLower().Contains("javascript:PFA".ToLower())
{
anc.InvokeMember("click");
}
}
It works for one row and not for the other row.
Source Website has following :
<td colspan="1" id="tdborder" align="left" width="5%">
<input name="appsWithStatusChg" type="checkbox" id="appsWithStatusChg1" alt='checkBoxLabel1'
label='checkBoxLabel1'
value="12114831" >
</td>
<td width="10%">
<a class="PairLink" tabindex="17" href="javascript:postForApplicationData('12114831')">
12/114,831
</td>
<td width="10%"> -</td>
<td width="14%"> US 2008-0209452 A1</td>
<td width="14%"> 1133-112US02</td>
<td width="11%"> 98449</td>
<td width="9%"> 12-24-2011</td>
<td width="17%"> 05-05-2008</td>
<td width="8%">
<!--<input type="button" name="submitForIFW" value="Review" id="submitForIFW" onClick="postForIFWData('12114831')" tabindex="9" >
-->
<a href="javascript:postForIFWData('12114831')" tabindex="9"> View</a>
</td>
</tr>
Problem is that when we try to invoke click event
for anchor tag whose tr is wpsTableShdRow is not working.
anchor tag whose tr is wpsTableNrmRow is working.
when we try to access click event manually it works.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)