Visual studio feeds

All Visual Studio blogs in one place

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Google+

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Search

A WebForm View with a Razor Layout in ASP.NET MVC 3

AddThis Social Bookmark Button
    Introduction:

          By default, ASP.NET MVC 3 ships with two built-in view engines: WebFormViewEngine and RazorViewEngine. WebFormViewEngine is for web form view and RazorViewEngine is for razor view. You can use a master page to create a consistent layout for your web form views and a razor layout for your razor views. But sometimes you may need to leverage a razor layout for your web form views. In this article, I will show you a trick that allows you to use a razor layout for your web form views.        Description:             First of all, create an ASP.NET MVC 3 application. Next, add
a controller, a web form view and a razor layout. Here is the code for controller,   public class HomeController : Controller { public ActionResult Index() { ViewBag.Message = "Welcome to ASP.NET MVC!"; return View(); } public ActionResult About() ...(Read whole news on source site)

Home : Blog List : Imran Baloch's Blog : A WebForm View with a Razor Layout in ASP.NET MVC 3