Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Master Page - controlling links
Message
From
29/10/2008 17:54:54
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01358074
Message ID:
01358209
Views:
29
>
>The same is true for accessing content from the master page that may be contained in a content page (eg. use FindControl on this.ContentPlaceHolder1, or whatever it's named). You can also just look at the Request.Path (or any of the other various Request paths) to determine which page you're on.

This was really way to easy!

In my Master Page Page_Load event handler
protected void Page_Load(object sender, EventArgs e)
{
     this.lnkSupportHome.Visible = true;
     this.lnkTrackerMain.Visible = true;
     this.lnkAdmin.Visible = false;

     if (Request.Path.Contains(@"/Tracker/Default.aspx"))
          this.lnkTrackerMain.Visible = false;

     if (Request.Path.Contains(@"/Support/Default.aspx"))
          this.lnkSupportHome.Visible = false;

     if (Session["IsAdmin"] != null)
     {
          if ((bool)Session["IsAdmin"] == true)
               this.lnkAdmin.Visible = true;
     }
}
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform