2015-07-21 71 views
0

我正在使用剃鬚刀引擎來解析.cshtml文件。我正在嘗試將基本模板文件更改爲System.Web.WebPages.WebPageBase。我已經發現了剃刀發動機有這件事情,我可以設置基本模板建立自定義基本模板剃鬚刀引擎

config.BaseTemplateType = typeof(MyCustomTemplateBase<>); 

的問題是,我不能將它直接System.Web.WebPages.WebPageBase。所以,我必須讓自己的自定義模板的基礎是這樣

public abstract class MyCustomTemplateBase<T> : WebPageRenderingBase 
{ 
    public override abstract HelperResult RenderPage(string path, params object[] data); 
} 

我只想RenderPage功能,但是當我運行程序的時候,給了我這些誤差修改

error: (25, 18) 'CompiledRazorTemplates.Dynamic.RazorEngine_e15164c444b34d6d84d05aef3c711cff' does not implement inherited abstract member 'CordovaBuild.MyCustomTemplateBase<dynamic>.RenderPage(string, params object[])' 
- error: (25, 18) 'CompiledRazorTemplates.Dynamic.RazorEngine_e15164c444b34d6d84d05aef3c711cff' does not implement inherited abstract member 'System.Web.WebPages.WebPageRenderingBase.Layout.get' 
- error: (25, 18) 'CompiledRazorTemplates.Dynamic.RazorEngine_e15164c444b34d6d84d05aef3c711cff' does not implement inherited abstract member 'System.Web.WebPages.WebPageRenderingBase.Layout.set' 
- error: (25, 18) 'CompiledRazorTemplates.Dynamic.RazorEngine_e15164c444b34d6d84d05aef3c711cff' does not implement inherited abstract member 'System.Web.WebPages.WebPageRenderingBase.PageData.get' 
- error: (25, 18) 'CompiledRazorTemplates.Dynamic.RazorEngine_e15164c444b34d6d84d05aef3c711cff' does not implement inherited abstract member 'System.Web.WebPages.WebPageRenderingBase.Page.get' 
- error: (25, 18) 'CompiledRazorTemplates.Dynamic.RazorEngine_e15164c444b34d6d84d05aef3c711cff' does not implement inherited abstract member 'System.Web.WebPages.WebPageRenderingBase.ExecutePageHierarchy()' 
- error: (25, 18) 'CompiledRazorTemplates.Dynamic.RazorEngine_e15164c444b34d6d84d05aef3c711cff' does not implement inherited abstract member 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' 
- error: (25, 18) 'CompiledRazorTemplates.Dynamic.RazorEngine_e15164c444b34d6d84d05aef3c711cff' does not implement inherited abstract member 'System.Web.WebPages.WebPageExecutingBase.Write(object)' 
- error: (25, 18) 'CompiledRazorTemplates.Dynamic.RazorEngine_e15164c444b34d6d84d05aef3c711cff' does not implement inherited abstract member 'System.Web.WebPages.WebPageExecutingBase.WriteLiteral 
+0

你爲什麼要這樣做?我問,因爲這似乎是一個[XY問題](http://meta.stackexchange.com/a/66378/171858),你在做什麼(Y)解決了一個問題(X),你沒有'描述。 –

回答

相關問題