To make a view strongly typed we can use @model and @inherit. Can you please tell me what the difference is between both of them?
@model
@inherit
Edit:
Please see this example.
The difference is as follows: if your view inherits from WebViewPage<T> then your model directive points to T.
WebViewPage<T>
T
In other words, these two are equivalent
@inherits System.Web.Mvc.WebViewPage<ModelClass>
and
@model ModelClass
Reference: http://weblogs.asp.net/scottgu/archive/2010/10/19/asp-net-mvc-3-new-model-directive-support-in-razor.aspx
1.4m articles
1.4m replys
5 comments
57.0k users