Reputation:
How to access the elements within an in WebBrowser in C#.NET?
Upvotes: 0
Views: 1520
Reputation: 3965
try this
webBrowser1.Document.GetElementById("idName").SetAttribute("value") = "ddddd" ;
var stuff=webBrowser1.Document.GetElementById("idName").GetAttribute("attribute");
it works for me when I need to get/set control data and get any html element value
Upvotes: 1
Reputation: 23016
As far as I understand you can access the controls inside the webbroswer control using the following code
WebBrowser1.Document.GetElementById("controlId").
Is this what you are looking for?
Additionally this discussion in daniweb might be of some interest to you.
Upvotes: 0
Reputation: 74530
Generally, you can't. C# and .NET are typically used in frameworks like ASP.NET to produce the content that is consumed by the browser. This happens on the server-side.
If .NET is installed on the client, then you can host a Windows Forms control in an HTML document in Internet Explorer but this is very, very non-standard, and I'd advise heavily against doing so.
Upvotes: 0