I want tried creating a strongly-type view user control in MVC3 by following this thread. Using a value type in strongly typed MVC view user control so that I could make it reusable however, whenever I try to modify the existing view user control (ViewUserControl) to a strongly-typed user control (ViewUserControl it throws and Error: Cannot resolve symbol ViewUserControl. Do you guys have any advice?
My code is as follows:
<%@ 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>