-1
我想試着在MVC3中創建一個強類型的視圖用戶控件。 Using a value type in strongly typed MVC view user control這樣我就可以使它可重用,但是,每當我嘗試修改現有的視圖用戶控件(ViewUserControl)到強類型的用戶控件(ViewUserControl它拋出和錯誤:無法解析符號ViewUserControl。你們有任何意見嗎?無法聲明一個強類型的MVC3查看用戶控件
我的代碼如下:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyReport>" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
// report generation code here
}
</script>
<form id="Form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<rsweb:ReportViewer ID="reportViewerControl" runat="server"
AsyncRendering="false" Height="387px" ShowBackButton="False"
ShowCredentialPrompts="False" ShowDocumentMapButton="False"
ShowFindControls="False" ShowPageNavigationControls="False"
ShowParameterPrompts="False" ShowRefreshButton="False" ShowToolBar="False"
SizeToReportContent="True" Width="979px"></rsweb:ReportViewer>
</form>