只是想獲得與mvccontrib 工作mvc4我定基頁在web.config中(以同樣的方式我在MVC3項目中所做的那樣)MvcContrib.FluentHtml.ModelWebViewPage和ASP.NET MVC4
<pages pageBaseType="MvcContrib.FluentHtml.ModelWebViewPage">
但在運行時間我得到一個錯誤:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0305: Using the generic type 'MvcContrib.FluentHtml.ModelWebViewPage<T>' requires 1 type arguments
Source Error:
Line 32:
Line 33:
Line 34: public class _Page_Views_Home_Index_cshtml : MvcContrib.FluentHtml.ModelWebViewPage {
Line 35:
Line 36: #line hidden
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\17698293\b6166ab6\App_Web_index.cshtml.a8d08dba.e7moq-gi.0.cs Line: 34
可能有人可以幫助嗎?有什麼想法嗎?
UPDATE:
貌似問題是:
如果我設置自定義的基類<pages pageBaseType="MvcContrib.FluentHtml.ModelWebViewPage">
,如果視圖沒有在這樣的情況下,它的任何自定義模式我收到這個錯誤。所以在這種情況下,我只需要將視圖中的模型設置爲@model dynamic,並且它會工作並且再次失敗,所以我只需將basePageType更改爲其默認值並使用MvcContrib.FluentHtml.ModelWebViewPage<dynamic> and MvcContrib.FluentHtml.ModelWebViewPage<MyModel>
,直到它將在下一個MvcContrib/MVC 4
版本中修復。