Accessing hidden fields in an ajax frame of a html document using Webbrowser1.Document

Hi, 

 

I have a windows form application that contains a webbrowser control.   (WebBrowser1)

The webbrowser control is populated with a html page.     (index.html)

The html page contains a dynamic ajax frame.                
(iframe name=page)

The ajax frame has a hidden filed that is dynamically populated.  (input type=”hidden” id=phone_number name=phone_number value=””)

I am trying to access the value of the hidden phone_number field in my windows for appliaction, for example….
HtmlDocumnent doc = WebBrowser1.Documnent ;

doc.body.GetAttribute(“phone_number”) doc.getElementsById(“phone_number”) doc.GetElementsByTagName(“phone_number”)

but none of these work.  I’ve tried all the properties of the WebBrowser HTMLDocument that I can think of but I can not access the hidden elements in the ajax frame!
I imagine it should be something like doc.frame.hidden_field???
Any suggestions greatly appreciated??
Thanks,
Al.

 

What about getting the “value” attribute of the element with ID “phone_number”?

Hi BigAl81,

Hi,  Thanks for all the replies, the line below did the trick.  It is necessary to append the GetAttribute property to the GetElementByID property to “see”  the contents of the hidden field!