1
添加自定義的控件將引發以下錯誤: -添加自定義控制罰全中查看錯誤
"\\Views\\Error\\Index.cshtml(9): error CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments"
這裏是索引頁的代碼: -
@{
ViewBag.Title = "Error";
}
<h2>
Sorry, an error occurred while processing your request.
</h2>
<div>@Html.RenderPartial("MyUserControl")
這裏的MyUserControl的代碼: -
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
hi
從視圖中刪除@Html.RenderPartial("MyUserControl")
的位置使頁面完美呈現。
那麼......錯誤是什麼?部分位於哪裏? – 2013-04-08 05:41:16
@SimonWhitehead,部分位於共享文件夾 – 2013-04-08 06:07:45
@SimonWhitehead,它會拋出以下錯誤: - 「\\ Views \\ Error \\ Index.cshtml(9):錯誤CS1502:'System.Web最好的重載方法匹配。 WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)'有一些無效的參數「 – 2013-04-08 06:15:33