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 5987575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:50:06+00:00 2026-05-22T22:50:06+00:00

Was wondering if someone could give me some direction on this. I’ve spent a

  • 0

Was wondering if someone could give me some direction on this. I’ve spent a decent amount of time on it and don’t seem to be getting anywhere:

I have a hidden field that I’m trying to parse out of an HTML document in VB.Net. I’m using a System.Windows.Controls.WebBrowser control in a WPF application and handling the LoadCompleted event. Inside the LoadCompleted event handler I do something like this:

Dim htmlDocument As mshtml.IHTMLDocument2 = Me.WebBrowser.Document
Dim allElements As mshtml.IHTMLElementCollection = htmlDocument.body.all
Dim hiddenField As mshtml.IHTMLInputElement = allElements.tags("hidField")

The hidden field that I’m trying to access is declared in my .aspx file as such:

<asp:HiddenField runat="server" ID="hidField"/>

The problem is that this allElements.tags("hidField") is returning null. Am I doing something wrong with the mshtml library? I don’t have much experience with it and gathered that I needed to do something like this to find my hidden field element. Let me know if you need more info. Thanks for the help in advance.

EDIT

Here’s is my final working solution for anyone interested:

    Dim htmlDocument As mshtml.IHTMLDocument2 = Me.WebBrowser.Document
    Dim allElements As mshtml.IHTMLElementCollection = htmlDocument.body.all
    Dim allInputs As mshtml.IHTMLElementCollection = allElements.tags("input")

    For Each element As mshtml.IHTMLInputElement In allInputs
        If element.type = "hidden" And element.name.Contains("hidField") Then
            MessageBox.Show(element.value)
        End If
    Next
  • 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-22T22:50:06+00:00Added an answer on May 22, 2026 at 10:50 pm

    You need to look for the rendered tag, not the serverside value.

    This will be rendered as an <input type="hidden">, so you need to use allElements.tags("input"), then find the specific hidden one. The id attribute may not end up as hidField – it depends on what container controls it is in and in what nesting level.

    I suggest using the HTML Agilty Pack to parse the HTML and find the element instead – it should be easier to use than MSHTML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't really understand Perl, so I was wondering if someone could give me
I was wondering if someone could give me some guidance here. I'd like to
I was wondering if someone could give me a simple solution to this. I
I was wondering if someone could give me some pointers on how to connect
I was just wondering if someone could give me some guidance on the best
Hi i was wondering if someone could give me a hand with this... I've
Wondering if someone could help give me a push in the right direction, I
I've started using RhinoAutoMocker and I was wondering if someone could give me hand
Just wondering if someone could point me in the right direction of how to
I was wondering if someone could provide some insight to as why when I

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.