In ASP.NET MVC 3, what class doe Views and Partial Views inheri开发者_高级运维t from and can the class (presumably it's a class somewhere) be inherited from to extend functionality.
For example, the default LogOnPartial control has the following (using Razor syntax)
Welcome <b>@Context.User.Identity.Name</b>!
Where is the Context object exposed. What class makes that available to the partial view?
They inherit from System.Web.Mvc.WebViewPage
. http://msdn.microsoft.com/en-us/library/system.web.mvc.webviewpage%28VS.98%29.aspx In older versions of razor it was required to add the @inherits
but newer versions don't.
精彩评论