Joe helped me build something similar and I'll share how that works here. I wanted a custom admin panel that only appeared at the top of the page when an admin was logged in. Here's how to do this:
In layout.master put something like this at the top (choose your own path to the file)
<%@ Register TagPrefix="pad" TagName="AdminNav" Src="~/_Custom/AdminBar.ascx" %>
In layout.master add this in place of the admin/editor links:
<div id="AdminPanel" runat="server" class="topnav" style="background-color: #FFFFCC; border: 1px dashed #C0C0C0; width: 99%; padding: 7px; margin: 0px">
<pad:AdminNav id="an1" runat="server"></pad:AdminNav>
<asp:ContentPlaceHolder id="pageEditContent" runat="server"></asp:ContentPlaceHolder> </div>
Here's the code in that AdminBar.ascx file:
<%@ Control Language="C#" AutoEventWireup="true" ClassName="AdminBar.ascx" Inherits="System.Web.UI.UserControl" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="mojoPortal.Business" %>
<%@ Import Namespace="mojoPortal.Business.WebHelpers" %>
<%@ Import Namespace="mojoPortal.Web.Framework" %>
<%@ Import Namespace="mojoPortal.Web.Controls" %>
<%@ Import Namespace="mojoPortal.Web.Editor" %>
<%@ Import Namespace="mojoPortal.Net" %>
<script runat="server">
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
}
protected void Page_Load(object sender, EventArgs e)
{
if(!WebUser.IsAdmin){ this.Visible = false;}
}
</script>
<ul>
<portal:WelcomeMessage id="WelcomeMessage" runat="server" ListItemCSS="firstnav" RenderAsListItem="true" />
<portal:HomeLink id="HomeLink" runat="server" RenderAsListItem="true" />
<portal:SiteMapLink id="SiteMapLink2" runat="server" CssClass="sitelink" RenderAsListItem="true" />
<portal:MyPageLink id="MyPageLink1" runat="server" RenderAsListItem="true" />
<portal:UserProfileLink id="UserProfileLink" runat="server" RenderAsListItem="true" />
<portal:MailboxLink id="MailboxLink1" runat="server" RenderAsListItem="true" />
<portal:RegisterLink id="RegisterLink" runat="server" RenderAsListItem="true" />
<portal:MemberListLink id="MemberListLink" runat="server" RenderAsListItem="true" />
<portal:SearchInput id="SearchInput1" LinkOnly="True" RenderAsListItem="true" runat="server" />
<portal:LoginLink id="LoginLink" runat="server" RenderAsListItem="true" />
<portal:LogoutLink id="LogoutLink" runat="server" RenderAsListItem="true" />
</ul>
<style type="text/css">div.topnav {display:block;}</style>
This apparently is how you display/show content in the layout.master file based on role. It's also a slick little admin bar for the top of your site so you don't need that "login" and other links to always display. My clients woulnd't like that being right on their public web sites for example.
How this helps someone.