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

Top MNC Interview Questions- Full Stack Developer

Interview Questions-2

How to get the user details, user current level, next level, Rank in sql server