Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4571376
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:29:42+00:00 2026-05-21T19:29:42+00:00

I have one main masterpage and three that inherit from it; my site changes

  • 0

I have one main masterpage and three that inherit from it; my site changes masterpages based on the state of the user (logged out, logged in without admin privileges, logged in with admin privileges) in order to change the side menu appropriately.

When I’m logged in, the master pages normaluser.master and admin.master work just fine.

When I’m logged out, loggedout.master fails to render any css from the stylesheet, turning my pretty side menu into a list of underlined blue links and removing all header styles.

MasterPage.master:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body style="background-color: rgb(231, 231, 255);height:100%;margin:0px;padding:0px">
    <form id="form1" runat="server">
    <div style="background-color:rgb(74, 60, 140);color: rgb(247, 247, 247);height:20%">
        <div style='width:7%;display:inline-block;border:none;padding:0px;padding-left:2px'>
            <img src="Images/globe2.png" style="height:100px;vertical-align:middle"/>
        </div>
        <div style='display:inline-block;vertical-align:middle;'>
            <span style='font-size:36pt;padding-left:10px;font-family:Century,inherit'> Welcome To MeetSmart: </span><span style="font-size:16pt;font-style:italic"> Your smarter meeting solution</span>
        </div>
    </div>
    <div style="height:80%">
        <div style='width:15%;height:100%;display:inline-block;text-align:center;margin-top:10px;padding:0px;'>
            <asp:ContentPlaceHolder id="Menu" runat="server">

            </asp:ContentPlaceHolder>

        </div>
        <div style='display:inline-block;margin:0px;padding-left:10px;padding-top:20px;border:2px solid purple;width:75%;height:100%;vertical-align:top'>
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

            </asp:ContentPlaceHolder>
        </div>
    </div>
    </form>
</body>
</html>

normaluser.master:

<%@ Master Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="normaluser.master.cs" Inherits="normaluser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<title>
<asp:ContentPlaceHolder id="title" runat="server">
</asp:ContentPlaceHolder>
</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Menu" Runat="Server">
        <div class='menuItem'> <a href="Schedule.aspx" class='menuItem'>My Schedule </a></div>
        <div class='menuItem'> <a href="MyProfile.aspx" class='menuItem'>My Profile </a></div>
        <div class='menuItem'> <a href="DocManagerUser.aspx" class='menuItem'>Document Center </a></div>
        <div class='menuItem'> <a href="Directory.aspx" class='menuItem'>Directory</a></div>
        <div class='menuItem'> <a href="Logout.aspx" class='menuItem'>Log out </a></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ContentPlaceHolder id="mainContent" runat="server">

    </asp:ContentPlaceHolder>
</asp:Content>

loggedout.master:

<%@ Master Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="LoggedOut.master.cs" Inherits="LoggedOut" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link runat="server" href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <title>

    <asp:ContentPlaceHolder id="title" runat="server">
    </asp:ContentPlaceHolder>
    </title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Menu" Runat="Server">
    <div class='menuItem'><a href="Login.aspx" class='menuItem'>Log In </a><br /></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ContentPlaceHolder id="mainContent" runat="server">
    </asp:ContentPlaceHolder>
</asp:Content>

With or without “runat=server”, the stylesheet link in loggedout does nothing; adding that was one way I tried to solve it. All the master pages and the stylesheet are in the same folder.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T19:29:43+00:00Added an answer on May 21, 2026 at 7:29 pm

    Considering your descriptions, looks like your CSS is in a directory which is secured under authentication. In order to have the CSS and scripts to be available on Login and other un-authenticated pages, you would need to make them available beyond authentication.

    To do this, you can add those CSS and scripts etc, to a directory (say Public folder on root) and use location element in web.config to provide access to everyone to these directoy. This has not compromise on your security as such.

    <configuration>
       <location path="Public">
          <system.web>
             <authorization>
                <allow users="*"/>
             </authorization>
          </system.web>
       </location>
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web project that I developed where one of the main functions
I have one main thread that does some rather CPU intensive operation. The thread
I have one main interface and an abstract class implementing all derivable methods (that
I have a WinForms TreeView with one main node and several sub-nodes. How can
When I have one app.config in my main project I always have to duplicate
With a distributed application, where you have lots of clients and one main server,
I have one field that I need to sum lets say named items However
I have one thread that writes results into a Queue. In another thread (GUI),
I have one hibernate sequence, that generates all sequence-numbers in my app. When I
I have a master page that divides the main content into two areas. There

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.