Friday 12 July 2013

Bind MasterPage Dynamically in the Page PreInit Event

protected void Page_PreInit(object sender, EventArgs e)
    {
        if (((Convert.ToString(this.Session["Login_Type"]) == "A") || (Convert.ToString(this.Session["Login_Type"]) == "E")) || (Convert.ToString(this.Session["Login_Type"]) == "B"))
        {
            this.Page.MasterPageFile = "AdminMasterPage.master";
        }
        else
        {
            this.Page.MasterPageFile = "AdminMasterPage.master";
        }
    }

No comments:

Post a Comment

C# LINQ Joins With SQL

There are  Different Types of SQL Joins  which are used to query data from more than one database tables. In this article, you will learn a...