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 

No comments:

Post a Comment

How to register multiple implementations of the same interface in Asp.Net Core?

 Problem: I have services that are derived from the same interface. public interface IService { } public class ServiceA : IService { ...