【发布时间】:2011-01-31 04:04:27
【问题描述】:
我像这样在 web.config 中设置了一个自定义 pageBaseType...
<pages pageBaseType="Status.Site.CustomWebViewPage">
在我的 cshtml 视图中,我这样做是为了确保我看到了 CustomWebViewPage 基类型。
Response.Write(this.GetType().FullName);
Response.Write(this.GetType().BaseType.FullName);
作为一个愚蠢的测试,我的 CustomWebViewPage 有一个方法 R,看起来像这样。
public abstract class CustomWebViewPage<T> : WebViewPage<T>
{
public void R(string content)
{
Response.Write(content);
}
}
这很好用,我可以从我的 cshtml 中调用我愚蠢的 R 方法并让它工作。
但是 - 我在 cshtml 文件中没有得到智能感知,这是一个很大的麻烦。
有什么想法吗?
【问题讨论】:
标签: asp.net-mvc-3 razor