开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜