I am working with rdlc report (ASP.Net MVC 4 with VS2012). Since view can't handle report viewer control I put the report viewer inside a user control file, .aspx file. Unfortunately when I render to view (WebForm1.aspx) it creates error: The view at 'WebForm1.aspx' must derive from ViewPage, ViewPage, ViewUserControl, or ViewUserControl.
I have searched the solution around the web but till now could find no solution. Do you have any idea?
I've inadvertently caused this to happen more than a few times in MVC applications, and it generally has to do with one of the following:
Having multiple versions of MVC referenced in the project. Similar to this question. I've had it bite me a few times when going from MVC 2 to MVC 3, though I can't say it's happened to me in MVC4.
MVC trying to use the wrong ViewEngine to render the View. Since you're using .aspx for the view, did you make sure to set up the project to use the WebForms view engine and not Razor? I'd imagine it'd probably toss that error if Razor was trying to parse WebForms.
Configuration files (specifically web.conf) not having the correct data for your project. Similar to this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With