Cristian Muscalu
Cristian Muscalu

Reputation: 9895

MVC can't access Models in Razor View

The project name is MVCMultipleModelTypes

@using MVCMultipleModelTypes.Models
@model Empl...beeeeeeeeepp.....

Does anyone know why i can't access the Models in the View? I loaded the project in Visual Studio 2015 and 2013 and same thing. The other projects work fine.

The pictre should tell the whole story. Can't Access Models

Upvotes: 1

Views: 2256

Answers (1)

Luke
Luke

Reputation: 23680

Your class needs to be defined as public for you to access it in the view.

public class Employee
{
    public string EmployeeName { get; set; }
}

Upvotes: 2

Related Questions