Monday, December 12, 2011

How to render a view without layout in ASP.NET MVC?


In_ViewStart.cshtml, Check if it is an ajax call. If yes set layout to null
    if (Request.IsAjaxRequest())
    {
        Layout = null;
    }
    else
    {
        Layout = "~/Views/Shared/_Layout.cshtml";
    }

No comments:

Post a Comment