-1

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>
Community
  • 1
  • 1
evablack
  • 117
  • 1
  • 2
  • 9

1 Answers1

0

I think you need to start again from scratch: http://www.asp.net/mvc/tutorials/overview/asp-net-mvc-overview

Your example isn't going to work because you are trying to mix two different frameworks.