Madhu
Madhu

Reputation: 2551

How to access the HTML elements using C# in Asp.net MVC?

I am doing a application using Asp.net MVC and In the model, I need to check whether the view page i am going to display have a element of specific id.I tried to use WebBrowser class to traverse my view page but it is showing error message as below.

`ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because   the current thread is not in a single-threaded apartment.` 

at the WebBrowser class.

So Any idea to solve this.

Upvotes: 1

Views: 2678

Answers (1)

Andrei
Andrei

Reputation: 44550

You have full control over your output HTML when developing apps using ASP.NET MVC. Define views to declare how the HTML should look like.

You cannot access HTML elements (DOM Tree) programmatically using C# with ASP.NET MVC

Upvotes: 5

Related Questions