Getting the error "The view at '~/Views/Page/home.aspx' must derive from ViewPage, ViewPage<TViewDat
Posted
by Glenn Slaven
on Stack Overflow
See other posts from Stack Overflow
or by Glenn Slaven
Published on 2010-03-18T06:03:23Z
Indexed on
2010/03/18
8:51 UTC
Read the original article
Hit count: 666
I've just installed MVC2 and I've got a view that looks like this
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Home.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Home
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Home</h2>
</asp:Content>
And the controller is just returning the view. But when I run the page I get this error:
System.InvalidOperationException: The view at '~/Views/Page/home.aspx' must derive from ViewPage, ViewPage, ViewUserControl, or ViewUserControl.
© Stack Overflow or respective owner