The view at ‘~/Views/Home/Index.aspx’ must derive from ViewPage, ViewPage, ViewUserControl, or ViewUserControl.
The view at ‘~/Views/Home/Index.aspx’ must derive from ViewPage, ViewPage<TViewData>, ViewUserControl, or ViewUserControl<TViewData>.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The view at ‘~/Views/Home/Index.aspx’ must derive from ViewPage, ViewPage<TViewData>, ViewUserControl, or ViewUserControl<TViewData>.
you will get a smiler exception if you have
Created a project using mvc 1.0 and then removed the reference mvc 1 and added mvc 2 or greater
in web.config file update the version from the line
<add assembly=”System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″/>
TO
<add assembly=”System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″/>
other sections of web.config like
<add verb=”*” path=”*.mvc” validate=”false” type=”System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″/>
<add name=”MvcHttpHandler” preCondition=”integratedMode” verb=”*” path=”*.mvc” type=”System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″/>
also do not forget to update the project file with correct version of mvc you are using
Recent Comments