1

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.

2
  • 9
    You have completely misunderstood what MVC is Commented Nov 18, 2013 at 10:47
  • 3
    You know if a view page has an element with a specific id because you wrote the view page yourself and put the element on it in the .cshtml or .aspx file. Commented Nov 18, 2013 at 10:48

1 Answer 1

5

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks buddy I just needed clarification whether is it possible or not? and now i got the answer thanks a lot..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.