What is ViewModel in ASP.NET MVC?
Ans. In ASP.NET
MVC, ViewModel is a class that contains the fields which are represented in the
strongly-typed view. It is used to
pass data from controller to strongly-typed view.
Key Points about ViewModel
ViewModel
contain fields that are represented in the view (for LabelFor, EditorFor,
DisplayFor helpers) ViewModel can have specific validation rules using data annotations.
ViewModel can
have multiple entities or objects from different data models or data source.
Explain ASP.NET MVC pipeline?
Ans. The detail ASP.NET MVC pipeline is given below:
1.
Routing - Routing is
the first step in ASP.NET MVC pipeline. Typically, it is a pattern matching
system that matches the incoming
request to the registered URL patterns in the Route Table.
The
UrlRoutingModule(System.Web.Routing.UrlRoutingModule) is a class which matches
an incoming HTTP request to a registered route pattern in the
RouteTable(System.Web.Routing.RouteTable).
No comments:
Post a Comment