Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27569

VB 2010 Webbrowser - How to click a link TWICE

$
0
0
Hello All;

I'm new to VB and hoping someone could help me with the following code. I have searched this forum and several others but couldn't find the correct answer :confused:.
Thank you in advance for your help.

What I'm trying to do is sort the DATE in descending order in a table by clicking the column heading link TWICE on a webpage. The link is a javascript. I'm successful in clicking it once, but I need to click it one more time (or may be I'm doing it all wrong in the first place) to get it to sort the way I want. I tried adding "elment. InvokeMember("click")" twice but that didn't work.

Here's HTML part:

HTML Code:

<th scope="col" style="white-space:nowrap;"><a href="javascript:PTWCControl_3_1.doPostBack('5709','frmGeneralInfo_5709','GridView1_5709','Sort$LastActivityDate')">Last Activity Date</a></th>
Here's the VB code. This code is working perfectly, by clicking once on the link, but I need to click it TWICE:

Code:

For Each elm As HtmlElement In WebBrowser1.Document.Links
          If elm.GetAttribute("href") = "javascript:__doPostBack('ctl08$btnLogOut','')" Then
                        elm.InvokeMember("click")
          End If
Next

Thank you kindly. Jb :)

Viewing all articles
Browse latest Browse all 27569

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>