error running view Asp.net mvc

Asked

Viewed 53 times

0

When running the project and calling the view is returning me the following error:

The view at '~/Views/Produto/List.cshtml' must derive from WebViewPage, or WebViewPage<TModel>.

View code:

@using Domain.Entidades
@model IEnumerable<Produto>

@{
    ViewBag.Title = "Produtos";
}
@foreach(var p in Model)
{
    <div>
        <h3>@p.Nome</h3>
        @p.Descricao
        <h4>@p.Price.ToString("c")</h4>
    </div>
}

How to solve?

  • Post the view code

  • Post the code for the List.cshtml file

  • added the code to the question

  • How is the file Web.config of the directory Views?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.