Interviews - C# Corner

Arjun Panwar
Can you change a Master Page dynamically at runtime?
By Arjun Panwar in ASP.NET on Nov 08 2012
  • Avdhesh Kumar
    Sep, 2017 26

    Yes , we can change master page at runtime like below code this.page.masterpagefile = "~/General.master";

    • 0
  • Rakesh Shinde
    Apr, 2013 23

    Yes..by this.masterpagefile=""

    • 0
  • Yogesh Sharma
    Nov, 2012 20

    protected void Page_PreInit(object sender, EventArgs e) { if (Membership.GetUser() == null) //check the user weather user is logged in or notthis.Page.MasterPageFile = "~/General.master";elsethis.Page.MasterPageFile = "~/myMaster.master"; }

    • 0

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS