1

HI I have a view that is created from the Controllder Method.

Now I am writing the HTML View Code on this Page.

Somehow I am not getting any html controls on this page. When i type the below line, it says "The name html doesn't exist in the current context" Ex: <%= Html.TextBox

Any Clue why i am not getting html tags.

Appreciate your response.

0

1 Answer 1

1

Are you missing your Inherits attribute in your Page declaration at the top of the view?

It should look like this (if it is strongly-typed):

Inherits="System.Web.Mvc.ViewPage<MyNamespace.Models.MyViewModel>"

or like this (if it is not strongly-typed):

Inherits="System.Web.Mvc.ViewPage"

I find that if I remove this declaration from my view, the Html object will no longer intellisense.

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

2 Comments

It is not strongly-typed. I also added Inherits = "System.Web.Mvc.ViewPage<IEnumerable<DataModel.Employees>>".
It is working now... Earlier it has some user controls code. After i have cleaned, it is working fine. Thanks Rob.

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.