Runtime class name for the view in ASP.NET MVC
Is there a way to get the actual type of the class generated for the view? For example, a view in SomeFolder/Edit.cshtml gets converted to a class of ASP._Page_Views_SomeFolder_Edit_cshtml by the runtime. 开发者_如何学JAVAHow can we get this type/classname?
In a view (Razor):
<div>@this.GetType()</div>
and if you are using WebForms:
<div><%= this.GetType() %></div>
As to the usefulness of doing such thing stays a complete mystery to me. Hope it makes sense to you.
精彩评论