ASP.NET MVC > Views - Razor Engine

specifying a model in razor view in ASP.NET MVC

How to specify a model for the razor view in asp.net mvc?


To specify a model for the View, we can using @model statement at the top of the View page. 

@model MVCTraining5.Models.PersonalDetail 

Now, in the following code the PersonalDetail class properties can be accessed using @Model word like 

@Model.FirstName 
 Views: 14120 | Post Order: 21



Write for us






Hosting Recommendations