How to Change Layout based on viewbag value in mvc view using Mvc,C#

 @{

    if (@ViewBag.lang == "en")

    {

        Layout = "Layout Name 1";

//This content uses above layout


    }

    if (@ViewBag.lang == "ar")

    {

        Layout = "Layout Name 2";

//This content uses above layout

    }

}

Comments

Popular posts from this blog

How to use youtube api's in your application.

Implement virtualisation in kendo drop down list using jquery ajax in mvc, aspx page

Interview Questions-2