Tag: ASP.NET MVC

Layout = null vs. ignoring Layout Property in ASP.NET MVC

What does Layout=null and ignoring the Layout property within the View means ? This is pretty simple , Layout=null , the view does not use any layout and the layout of the page will be the one used within the view. Ignoring the Layout property is a different story . Sometimes , ViewStart file can be used with the Views folder to define the layout…

How to Create Layout in ASP.NET MVC Project ?

The ASP.NET MVC Project includes the templates to create a layout for the website . In order to create a layout in ASP.NET MVC project , follow the below steps How to Create Layout in ASP.NET MVC Project ? 1. Right Click on the View Folder and select “Add New Item” in the context menu. 2. In the Add New Item Dialog , select the…

How to apply a Layout for a View in ASP.NET MVC ?

In the previous article , step by step procedure was provided on How to Create Layout in ASP.NET MVC Project ? . This article will explain how to apply a layout to a View in ASP.NET MVC. How to apply a Layout for a View in ASP.NET MVC ? The View has a property called “Layout” . This “Layout” property needs to be set in…

How to display a View from different controller in ASP.NET MVC 4 ?

Sometimes , it might be required to display a view from a different controller when developing website using ASP.NET MVC . How to display a View from different controller in ASP.NET MVC 4 ? This can be achieved by simply passing the view name along with the controller name to the return type of ActionResult like the wasy shown below. In the above example ,…

What is the difference between RouteLink and ActionLink in ASP.NET MVC ?

This article will cover some of the key differences between the RouteLink and ActionLink helper methods in ASP.NET MVC. What is the difference between RouteLink and ActionLink in ASP.NET MVC ? The Html.ActionLink renders the hyperlink tag to the specified controller action which uses the Routing API internally to generate URL. This renders the Anchor tag that links to the action method. The ActionLink method…

5 Alternative ASP.NET MVC View Engines

If you a ASP.NET MVC Web developer , you would have noticed that by default ASP.NET MVC includes 2 View Engines “Razor View” and “ASPX View”. In this article , we will explore other different View Engines(third party) available in ASP.NET. 5 Alternative ASP.NET MVC View Engines 1. Spark Spark is a open source view engine for ASP.NET MVC projects as well as Castle MonoRail…

ASP.NET MVC and View State

The ASP.NET Web Forms includes the Server Controls which generally retains the state of the controls in the hidden field called _ViewState . Does ASP.NET MVC have View State ? The concept of server controls in ASP.NET Web Forms is different from the ASP.NET MVC . The ASP.NET MVC does not maintain the _ViewState in the HTML pages that is rendered by Razor or ASPX…

4 Best Practices for ASP.NET MVC Application

There are plenty of best practices for ASP.NET MVC Application which can be followed by the ASP.NET MVC Project developer. In this blog post , we will cover 4 of the best practices when developing ASP.NET Web Applications. 4 Best Practices for ASP.NET MVC Application 1. Request Validation The Request Validation is one of the features in ASP.NET MVC which is enabled by default and…

ViewBag and DynamicObject in ASP.NET MVC

ViewBag is used in ASP.NET MVC to pass data from the controller to View . It is a dynamic object and is a member of the Controller class. Any dynamic property with its value can be assigned and later be used to retrieve it in the View. Below is a sample code snippet on the usage of the ViewBag to store the ApplicationTitle and later…

Liked this content?. Please spread the word :)