Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1007401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:36:43+00:00 2026-05-16T08:36:43+00:00

C# Visual Studio 2010 I am loading a complex html page into a webbrowser

  • 0

C# Visual Studio 2010

I am loading a complex html page into a webbrowser control. But, I don’t have the ability to modify the webpage. I want to click a link on the page automatically from the windows form. But, the ID appears to be randomly generated each time the page is loaded (so I believe referencing the ID will not work).

This is the content of the a href link:

<a 

id="u_lp_id_58547"
href="javascript:void(0)"
class="SGLeftPanelText" onclick="setStoreParams('cases;212', 212); window.leftpanel.onClick('cases_ss_733');return false; ">

My Assigned</a>

Is the anyway to click the link from C#?

Thanks!


UPDATE:

I feel like this is close but it is just not working:

HtmlElementCollection links = helpdeskWebBrowser.Document.Window.Frames["main_pending_events_frame"].Document.GetElementsByTagName("a");
MessageBox.Show(links.Count.ToString());

I have tried plugging in every single frame name and tried both “a” and “A” in the TagName field but just have not had any luck. I can just not find any links; the message box is always 0. What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:36:44+00:00Added an answer on May 16, 2026 at 8:36 am

    Something like this should work:

    HtmlElement link = webBrowser.Document.GetElementByID("u_lp_id_58547")
    link.InvokeMember("Click")
    

    EDIT:

    Since the IDs are generated randomly, another option may be to identify the links by their InnerText; along these lines.

    HtmlElementCollection links = webBrowser.Document.GetElementsByTagName("A");
    
    foreach (HtmlElement link in links)
    {
        if (link.InnerText.Equals("My Assigned"))
            link.InvokeMember("Click");
    }
    

    UPDATE:

    You can get the links within an IFrame using:

    webBrowser.Document.Window.Frames["MyIFrame"].Document.GetElementsByTagName("A");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Visual Studio 2010 RC -> Silverlight Application We have a library of images that
Visual Studio 2010 Express, Windows Forms. Have made myself my first little application which
Background - Visual Studio 2010, C#, .Net Framework 4.0 application I have a web
Since Visual Studio 2010 is slated for release in March of 2010 and HTML
Visual Studio 2010 crashes when loading Just trying to start Visual Studio 2010 to
My scenario I'm using Visual Studio 2010 with Entity Framework 4.1 I have a
I have MS VS 2010 installed on my Windows 7 but, I don't have
I have a Visual Studio 2010 solution with 3 projects. The first is an
I have a weird situation: Visual Studio 2010 will hang up indefinitely on me
I am using Visual Studio 2010 Professional Edition, and Windows Vista. Firstly, I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.