Hi All, Partial view is a reusable view which can be embedded inside other view.Like a user control it can be used in different areas of a page. It can used with left menu, header and footer as shown in the image below. Once the partial view is created we can call the partial view… Read More »
Hi All, Routing helps us to give user friendly URL structure. Helps to map those URL structure to the controller.When any user types “http://localhost/View/ViewStudent/” , it will goes to the “Customer” Controller and invokes “DisplayStudent” action. This is defined by adding an entry in to the “routes” collection using the “maproute” function.
Temp data: Helps to maintain data when you move from one controller to other controller or from one action to other action. In other words when you redirect,“tempdata” helps to maintain data between those redirects. It internally uses session variables. View data: Helps to maintain data when you move from controller to view. View Bag: … Read More »
Hi Friends, We can decorate the MVC action by “HttpGet” or “HttpPost” attribute to restrict the type of HTTP calls. For instance you can see in the below code snippet the “DisplayCustomer” action can only be invoked by “HttpGet”. If we try to make Http post on “DisplayCustomer” it will throw an error.
Hi All, By using ActionLink method as shown in the below . The below code will create a simple URL which help to navigate to the Home controller and invoke the GotoHome action
Hi friends, I have gone through some existing features of MVC in its history. MVC Framework have too many features and in each release they have added new features. ASP.NET MVC1 MVC1 was Released on Mar 13, 2009 Runs on .NET 3.5 Runs in Visual Studio 2008 & Visual Studio 2008 SP1 MVC Pattern architecture… Read More »
The Unity Application Block (Unity) is a lightweight container for dependency injection. Using DI frameworks developers can generate and assemble instances of custom classes and objects that can contain dependent object instances and settings. 1. Constructor injection 2. Method call injection 3. Property injection It helps developers with the following features : Simplifies code Specify… Read More »
MVC is an architectural pattern. It separates the representation and the user interaction in an Application. In MVC there are three important sections. Model,View and Controller. Please see details below. View is responsible for look and feel. Model provides data to the View. Controller is responsible to take the end user request and load the… Read More »
DTO (Data Transfer objects) is a container for passing data between layers. DTO’s are also termed as transfer objects. DTO is used to pass data and does not contain any business logic in it. Setters and Getters are used in DTO.
Hi All, We can show/hide sections in MVC application using following steps. Step 1 : Add following class in CSS Step 2 : Check model value and set variable with CSS class name accordingly Step 3 : Add @showActive as class in place where you want to show/hide sections according to the value of StudentID