locked
How to set CSS color settings from web.config RRS feed

  • Question

  • User-1592694395 posted
    I have a website using a master page where the master page uses css style settings for the background color of the navigation bar, grid headers, etc.  So, MasterShell.master has:
    /* The web site color scheme is set by the hex color in the folowing 4 color definitions */
    		.primary-background-color
    		{
    			background-color: #126192;
    		}
    		.primary-font-color {
    			color: #126192;
    		}

     I distribute this website out to my customers.  I want to set the color to the customers corporate color scheme.  Ideally I would like to set the color once, for example as a property in web.config, like:

    <APPSETTINGS><appSettings>
       <add key=<ADD class=st key=""customerColor" value="#126192"/>
    </APPSETTINGS></appSettings>
    and then be able to pull this appSetting code value in to the css style.  Is there a way to do this?
    Thanks.
    Tuesday, November 18, 2008 2:27 PM

Answers

  • User815882678 posted

    Here is a working example:

    CSSFromWebConfig.aspx:

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CSSFromWebConfig.aspx.cs" Inherits="ForForums.CSSFromWebConfig" %>
    
    <!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 runat="server">
        <title>Untitled Page</title>
            <style type="text/css">
    
    		.primary-background-color
    		{
    			background-color: #126192;
    		}
    		.primary-font-color {
    			color: <%= ConfigurationManager.AppSettings["customerColor"] %>;
    		} 
    
    </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div class="primary-font-color">
        Test Color
        </div>
        </form>
    </body>
    </html>
    

     

    CSSFromWebConfig.aspx.cs:

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    namespace ForForums
    {
        public partial class CSSFromWebConfig : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
        }
    }
    

     

    web.config:

      <appSettings>
        <add key="customerColor" value="#126192"/>
      </appSettings>
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 18, 2008 3:11 PM
  • User815882678 posted

    I tried your code sample, but I get this error:

     [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]

    The <style> block is in the head of a master page.

    Here is a working example using a master page.

    CSSFromWebConfig.Master:

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="CSSFromWebConfig.master.cs" Inherits="ForForums.CSSFromWebConfig1" %>
    
    <!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 runat="server">
        <title>Untitled Page</title>
                <style type="text/css">
    
    		.primary-background-color
    		{
    			background-color: #126192;
    		}
    		.primary-font-color {
    			color: <%= ConfigurationManager.AppSettings["customerColor"] %>;
    		} 
    
    </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>

    CSSFromWebConfig.Master.cs:

     

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    namespace ForForums
    {
        public partial class CSSFromWebConfig1 : System.Web.UI.MasterPage
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
        }
    }
    
     

    CSSFromWebConfig2.aspx:

    <%@ Page Language="C#" MasterPageFile="~/CSSFromWebConfig.Master" AutoEventWireup="true" 
    CodeBehind="CSSFromWebConfig2.aspx.cs" Inherits="ForForums.CSSFromWebConfig2" Title="Untitled Page" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <div class="primary-font-color">
        Test Color 2
        </div>
    </asp:Content>
    

     

    CSSFromWebConfig2.aspx.cs:

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    namespace ForForums
    {
        public partial class CSSFromWebConfig2 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
        }
    }
    
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 19, 2008 10:34 AM
  • User-1592694395 posted

    There must be something odd about my code because this does not work for me.  The build tells me:

    Validation (CSS 2.0): '<%=' is not a valid value for the 'background-color' property.

    I'm using VS 2008 with .NET 3.5 SP1.

    Here's my full master page aspx code in case you can see anything wrong with it.  I'm going to take your example code and load it in to see what happens.

     <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterShell.master.cs" Inherits="Master_MasterShell" %>
    <%@ Register Assembly="RadTabStrip.Net2" Namespace="Telerik.WebControls" TagPrefix="radTS" %>
    <%@ Register Assembly="RadToolbar.Net2" Namespace="Telerik.WebControls" TagPrefix="radTlb" %>

    <%@ Register src="../Controls/Accordion.ascx" tagname="Accordion" tagprefix="uc1" %>

    <!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 runat="server">
        <title>CPR+ Web Portal</title>
        <link href="../RadControls/Toolbar/Skins/Web20/web20.css" rel="stylesheet" type="text/css" />
        <link href="../RadControls/Grid/Skins/Monochrome/Styles.css" rel="stylesheet" type="text/css" />
        <link type="text/css" rel="stylesheet" href="../Styles/ContentPage.css" />

        <script type="text/javascript" src="../RadControls/Ajax/Scripts/1_8_6/RadAJAXNamespace.js"></script>

        <script type="text/javascript" src="../RadControls/Ajax/Scripts/1_8_6/RadAJAX.js"></script>

        <script type="text/javascript" src="../RadControls/Calendar/Scripts/2_2_6/RadCalendar.js"></script>

        <script type='text/javascript' src='../RadControls/Combobox/Scripts/2_8_6/RadComboBox.js'></script>

        <script type="text/javascript" src="../RadControls/Grid/Scripts/5_1_4/RadAJAXNamespace.js"></script>

        <script type="text/javascript" src="../RadControls/Grid/Scripts/5_1_4/RadGrid.js"></script>

        <script type="text/javascript" src="../RadControls/Input/Scripts/2_1_6/RadDateInput.js"></script>

        <script type="text/javascript" src="../RadControls/Input/Scripts/2_1_6/RadInput.js"></script>

        <script type="text/javascript" src="../RadControls/Input/Scripts/2_1_6/RadMaskedInput.js"></script>

        <script type="text/javascript" src="../RadControls/Input/Scripts/2_1_6/RadNumericInput.js"></script>

        <script type="text/javascript" src="../RadControls/Toolbar/Scripts/1_6_6/RadToolbar.js"></script>
       
        <script type="text/javascript" src="../RadControls/Toolbar/Scripts/1_6_6/RadButton.js"></script>

        <script type="text/javascript" src="../RadControls/Window/Scripts/1_9_6/RadWindowClient.js"></script>
     
      <style type="text/css">
      body {

       background-color: #e3e3e3;

       margin: 0;

       padding: 0;

       font-family: Arial, "MS Trebuchet", sans-serif;

       height: 100%;

      }

      table {

       margin: 0;

       padding: 0;

       border: 0 none;

      }

      tbody, tr, td {

       margin: 0;

       padding: 0;

      }

      #page {

       margin: 0 auto;

       padding-left: 1px;

       padding-right: 1px;

       width: 988px;

       background-color: white;

       display: block;

       border-left: 1px solid #CCC;

       border-right: 1px solid #CCC;

       height: 100%;

      }

      #header {

       padding-bottom: 15px;

       background-image: url(../MasterImages/header-background.jpg);

       background-repeat: repeat-y;

       background- 50%;

       width: 100%;

      }

      #bar {

       width: 100%;

       height: 5px;

       float: left;

      }

      #logo {

       padding-left: 20px;

      }

      #portal-name {

       ;

       margin-top: 25px;

       margin-left: 447px;

       width: 346px;

       font-size: 28px;

      }

      ul#menu {

       padding: 0 0 0 640px;

       margin: -5px 0 0 0;

       list-style-type: none;

       float: left;

       white-space: nowrap;

      }

      ul#menu li {

       display: inline;

      }

      ul#menu li a {

       color: #444;

       background-color: #F2F2F2;

       padding: 4px 10px;

       float: left;

       text-decoration: none;

       font-size: 11px;

       border: 1px solid #CCC;

      }

      ul#menu li#log-off a {

       margin-left: 10px;

      }

      
    #main {

       border-top: 1px solid #CCC;

       border-bottom: 1px solid #CCC;

       height: 100%;

      }

      .left {

       vertical-align: top;

       padding-top: 22px;

       width: 173px;

      }

      .right {
       vertical-align: top;

       width: 795px;

      }

      #two-column {

       margin-left: 20px;

      }

      .navigation-separator {

       margin: 0;

       padding: 0;

       display: block;

      }

      #navigation-box {


      }

      #navigation {

       background-color: white;

       margin-bottom: 40px;

      }

      #navigation a {

       text-decoration: none;

       font-size: 11px;

      }

      #navigation .accordion_nochildren {

       font-weight: bold;

       margin: 0;

      }

      .accordion_nochildren {

       margin-left: 5px;

       background-color: White;

      }

      .accordion_nochildren a {

       padding-left: 10px;

       background-image: url(../MasterImages/bullet-primary.gif);

       background-repeat: no-repeat;

       background- 4px;

      }

      #navigation .accordion_toggle {

       font-weight: bold;

       margin: 0;

      }

      .accordion_toggle {

       margin-left: 5px;

       background-color: White;

      }

      .accordion_toggle a {

       padding-left: 10px;

       background-image: url(../MasterImages/bullet-primary.gif);

       background-repeat: no-repeat;

       background- 4px;

      }

      #navigation .accordion_content {

       padding-left: 15px;

      }
      .accordion_content a {

       margin-left: 13px;

       color: #999;

      }

      .accordion_content ul{

       list-style-type: none;

       margin: 0px;

       padding: 0px;

      }

      
    #content {

       padding-top: 20px;

       padding-left: 30px;

       color: #6b6d6f;

       font-size: 11px;

      }

      h1 {

       margin: 0px;

       padding: 0px;

       font-size: 18px;

       font-weight: normal;

      }

      p.instructions {

       width: 500px;

      }

      
    #footer {

       clear: both;

      }

      #powered {

       margin: 8px;

       padding-left: 875px

      }

      
    /* The web site color scheme is set by the hex color in the folowing 4 color definitions */

      .primary-background-color {

       background-color: <%= ConfigurationManager.AppSettings["customerColor"] %>;

      }

      .primary-font-color {

       color: <%= ConfigurationManager.AppSettings["customerColor"] %>;

      }

      .primary-font-color a
    {

       color: #126192;

      }

      .GridHeader_Monochrome,
              .ResizeHeader_Monochrome
              {
               color: white;
               height: 34px;
               background: #126192;
              }

      
    .current_page {

       color: #444;

      }

      .accordion_content a.currentPage {

       color: #444;

      }

      .accordion_nochildren a.currentPage {
       color: #444;
      }

      .bold {

       font-weight: bold;

      }

    .info-row {
        width: 93%;
        display: block;
        padding: 15px;
        /*height: 125px; */
        }
        .gradient {
        background-image: url(../NewImages/row_gradient.jpg);
        background-repeat: repeat-x;
        background- 100%;
        border-top: 1px solid #CCC;
        border-bottom: 1px solid #CCC;
        }
        .info-label
        {
         margin-bottom: 10px;
        }
        .info-left {
        width: 250px;
        vertical-align:top;
        }
        .info-right
        {
     vertical-align:top;
        }
     .info-value {
        color: black;
        font-weight: bold;
        font-size: 12px;
        }
     h1.row-heading {
        font-size: 15px;
        font-weight: bold;
        margin-bottom: 10px;
        }
     .info-button
     {
        margin-left: 595px;
        display:block;
        padding:5px 10px;
        text-align:center;
        width:100px;
        color: white;
        }
        .info-button a
        {
         color:White;
        }
        .ref-col1 {
        width: 100px;
        vertical-align:top;
        }
        .ref-col2 {
        width: 200px;
        vertical-align:top;
        }
        .ref-col3 {
        width: 100px;
        vertical-align:top;
        }
        .ref-col4 {
        width: 200px;
        vertical-align:top;
        }
     </style>
       
    </head>
    <body style="text-align: left;">
        <form runat="server" id="mainform">
    <div id="page">

     <div id="header">

      <div id="bar" class="primary-background-color"></div>

      <ul id="menu">

       <li id="privacy"><a href="http://forums.asp.net/t/1349824.aspx#">Privacy</a></li>

       <li id="security"><a href="http://forums.asp.net/t/1349824.aspx#">Security</a></li>

       <li id="help"><a href="http://forums.asp.net/t/1349824.aspx#">Help</a></li>

       <li id="contact-us"><a href="http://forums.asp.net/t/1349824.aspx#">Contact Us</a></li>

       <li id="log-off"><asp:LinkButton ID="linkLogOff" runat="server" onclick="linkLogOff_Click" CausesValidation="False">Log Off</asp:LinkButton></li>

      </ul>

      <img src="../MasterImages/logo.jpg" width="174" height="65" alt="Logo" id="logo" />

      <span id="portal-name" class="primary-font-color">WEB PORTAL</span>
     </div>
     <div id="main">
      <table cellspacing="0" cellpadding="0" id="two-column">
       <tbody>
        <tr>
         <td class="left primary-background-color">
          <div id="navigation-box" class="primary-background-color">
           <div id="navigation">
                               <uc1:Accordion ID="Accordion1" runat="server" />

                          </div>

          </div>

          &nbsp;

         </td>

         <td class="right">

          <div id="content">

                              <asp:ContentPlaceHolder ID="shellContent" runat="server">
                              </asp:ContentPlaceHolder>

          </div>

         </td>

        </tr>

       </tbody>

      </table>

     </div>

     <div id="footer">

      <img src="../MasterImages/poweredbycpr.jpg" width="93" height="11" alt="Poweredbycpr" id="powered" />

     </div>
    </div>
        </form>
    </body>
    </html>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 19, 2008 11:57 AM

All replies

  • User815882678 posted

    You have your web.config key created. Next, add a class to simplify accessing the values.

    Settings.cs:

     

    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    namespace ProjectName.ClassLibrary
    {
        public class Settings
        {
    
            public static string CustomColor
            {
                get
                {
                    return ConfigurationManager.AppSettings["CustomColor"];
                }
            }
    
            public static string CustomColor2
            {
                get
                {
                    return ConfigurationManager.AppSettings["CustomColor2"];
                }
            }
    
        }
    }
    

     

    Then, reference the values from your aspx page like this:

    <%= ClassLibrary.Settings.CustomColor %>
     
    Tuesday, November 18, 2008 2:43 PM
  • User-1592694395 posted

    Yes, thanks for your response.  I see how to pull the color setting out of appSettings.  What I am struggling with is how to get the value into the css color settings from the master page code-behind.

    Tuesday, November 18, 2008 2:53 PM
  • User-195170531 posted

     Hi, what is difference between changing color in web.config or directly in css? Or use application themes for this task. As far as I know there is no any special class or object to get access to css file from C# code, but you can work with css file as with all other files using System.IO ;)

    Tuesday, November 18, 2008 2:53 PM
  • User815882678 posted

    What I am struggling with is how to get the value into the css color settings from the master page code-behind.

    What is the extension of the page you are trying to get the color settings to from the web.config? Is it a .css file, or is it a .cs code behind?

    Tuesday, November 18, 2008 3:00 PM
  • User815882678 posted

    Here is a working example:

    CSSFromWebConfig.aspx:

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CSSFromWebConfig.aspx.cs" Inherits="ForForums.CSSFromWebConfig" %>
    
    <!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 runat="server">
        <title>Untitled Page</title>
            <style type="text/css">
    
    		.primary-background-color
    		{
    			background-color: #126192;
    		}
    		.primary-font-color {
    			color: <%= ConfigurationManager.AppSettings["customerColor"] %>;
    		} 
    
    </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div class="primary-font-color">
        Test Color
        </div>
        </form>
    </body>
    </html>
    

     

    CSSFromWebConfig.aspx.cs:

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    namespace ForForums
    {
        public partial class CSSFromWebConfig : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
        }
    }
    

     

    web.config:

      <appSettings>
        <add key="customerColor" value="#126192"/>
      </appSettings>
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 18, 2008 3:11 PM
  • User-1592694395 posted

    I tried your code sample, but I get this error:

     [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]

    The <style> block is in the head of a master page.

    Wednesday, November 19, 2008 8:22 AM
  • User815882678 posted

    I tried your code sample, but I get this error:

     [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]

    The <style> block is in the head of a master page.

    Here is a working example using a master page.

    CSSFromWebConfig.Master:

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="CSSFromWebConfig.master.cs" Inherits="ForForums.CSSFromWebConfig1" %>
    
    <!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 runat="server">
        <title>Untitled Page</title>
                <style type="text/css">
    
    		.primary-background-color
    		{
    			background-color: #126192;
    		}
    		.primary-font-color {
    			color: <%= ConfigurationManager.AppSettings["customerColor"] %>;
    		} 
    
    </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>

    CSSFromWebConfig.Master.cs:

     

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    namespace ForForums
    {
        public partial class CSSFromWebConfig1 : System.Web.UI.MasterPage
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
        }
    }
    
     

    CSSFromWebConfig2.aspx:

    <%@ Page Language="C#" MasterPageFile="~/CSSFromWebConfig.Master" AutoEventWireup="true" 
    CodeBehind="CSSFromWebConfig2.aspx.cs" Inherits="ForForums.CSSFromWebConfig2" Title="Untitled Page" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <div class="primary-font-color">
        Test Color 2
        </div>
    </asp:Content>
    

     

    CSSFromWebConfig2.aspx.cs:

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    namespace ForForums
    {
        public partial class CSSFromWebConfig2 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
        }
    }
    
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 19, 2008 10:34 AM
  • User-1592694395 posted

    There must be something odd about my code because this does not work for me.  The build tells me:

    Validation (CSS 2.0): '<%=' is not a valid value for the 'background-color' property.

    I'm using VS 2008 with .NET 3.5 SP1.

    Here's my full master page aspx code in case you can see anything wrong with it.  I'm going to take your example code and load it in to see what happens.

     <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterShell.master.cs" Inherits="Master_MasterShell" %>
    <%@ Register Assembly="RadTabStrip.Net2" Namespace="Telerik.WebControls" TagPrefix="radTS" %>
    <%@ Register Assembly="RadToolbar.Net2" Namespace="Telerik.WebControls" TagPrefix="radTlb" %>

    <%@ Register src="../Controls/Accordion.ascx" tagname="Accordion" tagprefix="uc1" %>

    <!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 runat="server">
        <title>CPR+ Web Portal</title>
        <link href="../RadControls/Toolbar/Skins/Web20/web20.css" rel="stylesheet" type="text/css" />
        <link href="../RadControls/Grid/Skins/Monochrome/Styles.css" rel="stylesheet" type="text/css" />
        <link type="text/css" rel="stylesheet" href="../Styles/ContentPage.css" />

        <script type="text/javascript" src="../RadControls/Ajax/Scripts/1_8_6/RadAJAXNamespace.js"></script>

        <script type="text/javascript" src="../RadControls/Ajax/Scripts/1_8_6/RadAJAX.js"></script>

        <script type="text/javascript" src="../RadControls/Calendar/Scripts/2_2_6/RadCalendar.js"></script>

        <script type='text/javascript' src='../RadControls/Combobox/Scripts/2_8_6/RadComboBox.js'></script>

        <script type="text/javascript" src="../RadControls/Grid/Scripts/5_1_4/RadAJAXNamespace.js"></script>

        <script type="text/javascript" src="../RadControls/Grid/Scripts/5_1_4/RadGrid.js"></script>

        <script type="text/javascript" src="../RadControls/Input/Scripts/2_1_6/RadDateInput.js"></script>

        <script type="text/javascript" src="../RadControls/Input/Scripts/2_1_6/RadInput.js"></script>

        <script type="text/javascript" src="../RadControls/Input/Scripts/2_1_6/RadMaskedInput.js"></script>

        <script type="text/javascript" src="../RadControls/Input/Scripts/2_1_6/RadNumericInput.js"></script>

        <script type="text/javascript" src="../RadControls/Toolbar/Scripts/1_6_6/RadToolbar.js"></script>
       
        <script type="text/javascript" src="../RadControls/Toolbar/Scripts/1_6_6/RadButton.js"></script>

        <script type="text/javascript" src="../RadControls/Window/Scripts/1_9_6/RadWindowClient.js"></script>
     
      <style type="text/css">
      body {

       background-color: #e3e3e3;

       margin: 0;

       padding: 0;

       font-family: Arial, "MS Trebuchet", sans-serif;

       height: 100%;

      }

      table {

       margin: 0;

       padding: 0;

       border: 0 none;

      }

      tbody, tr, td {

       margin: 0;

       padding: 0;

      }

      #page {

       margin: 0 auto;

       padding-left: 1px;

       padding-right: 1px;

       width: 988px;

       background-color: white;

       display: block;

       border-left: 1px solid #CCC;

       border-right: 1px solid #CCC;

       height: 100%;

      }

      #header {

       padding-bottom: 15px;

       background-image: url(../MasterImages/header-background.jpg);

       background-repeat: repeat-y;

       background- 50%;

       width: 100%;

      }

      #bar {

       width: 100%;

       height: 5px;

       float: left;

      }

      #logo {

       padding-left: 20px;

      }

      #portal-name {

       ;

       margin-top: 25px;

       margin-left: 447px;

       width: 346px;

       font-size: 28px;

      }

      ul#menu {

       padding: 0 0 0 640px;

       margin: -5px 0 0 0;

       list-style-type: none;

       float: left;

       white-space: nowrap;

      }

      ul#menu li {

       display: inline;

      }

      ul#menu li a {

       color: #444;

       background-color: #F2F2F2;

       padding: 4px 10px;

       float: left;

       text-decoration: none;

       font-size: 11px;

       border: 1px solid #CCC;

      }

      ul#menu li#log-off a {

       margin-left: 10px;

      }

      
    #main {

       border-top: 1px solid #CCC;

       border-bottom: 1px solid #CCC;

       height: 100%;

      }

      .left {

       vertical-align: top;

       padding-top: 22px;

       width: 173px;

      }

      .right {
       vertical-align: top;

       width: 795px;

      }

      #two-column {

       margin-left: 20px;

      }

      .navigation-separator {

       margin: 0;

       padding: 0;

       display: block;

      }

      #navigation-box {


      }

      #navigation {

       background-color: white;

       margin-bottom: 40px;

      }

      #navigation a {

       text-decoration: none;

       font-size: 11px;

      }

      #navigation .accordion_nochildren {

       font-weight: bold;

       margin: 0;

      }

      .accordion_nochildren {

       margin-left: 5px;

       background-color: White;

      }

      .accordion_nochildren a {

       padding-left: 10px;

       background-image: url(../MasterImages/bullet-primary.gif);

       background-repeat: no-repeat;

       background- 4px;

      }

      #navigation .accordion_toggle {

       font-weight: bold;

       margin: 0;

      }

      .accordion_toggle {

       margin-left: 5px;

       background-color: White;

      }

      .accordion_toggle a {

       padding-left: 10px;

       background-image: url(../MasterImages/bullet-primary.gif);

       background-repeat: no-repeat;

       background- 4px;

      }

      #navigation .accordion_content {

       padding-left: 15px;

      }
      .accordion_content a {

       margin-left: 13px;

       color: #999;

      }

      .accordion_content ul{

       list-style-type: none;

       margin: 0px;

       padding: 0px;

      }

      
    #content {

       padding-top: 20px;

       padding-left: 30px;

       color: #6b6d6f;

       font-size: 11px;

      }

      h1 {

       margin: 0px;

       padding: 0px;

       font-size: 18px;

       font-weight: normal;

      }

      p.instructions {

       width: 500px;

      }

      
    #footer {

       clear: both;

      }

      #powered {

       margin: 8px;

       padding-left: 875px

      }

      
    /* The web site color scheme is set by the hex color in the folowing 4 color definitions */

      .primary-background-color {

       background-color: <%= ConfigurationManager.AppSettings["customerColor"] %>;

      }

      .primary-font-color {

       color: <%= ConfigurationManager.AppSettings["customerColor"] %>;

      }

      .primary-font-color a
    {

       color: #126192;

      }

      .GridHeader_Monochrome,
              .ResizeHeader_Monochrome
              {
               color: white;
               height: 34px;
               background: #126192;
              }

      
    .current_page {

       color: #444;

      }

      .accordion_content a.currentPage {

       color: #444;

      }

      .accordion_nochildren a.currentPage {
       color: #444;
      }

      .bold {

       font-weight: bold;

      }

    .info-row {
        width: 93%;
        display: block;
        padding: 15px;
        /*height: 125px; */
        }
        .gradient {
        background-image: url(../NewImages/row_gradient.jpg);
        background-repeat: repeat-x;
        background- 100%;
        border-top: 1px solid #CCC;
        border-bottom: 1px solid #CCC;
        }
        .info-label
        {
         margin-bottom: 10px;
        }
        .info-left {
        width: 250px;
        vertical-align:top;
        }
        .info-right
        {
     vertical-align:top;
        }
     .info-value {
        color: black;
        font-weight: bold;
        font-size: 12px;
        }
     h1.row-heading {
        font-size: 15px;
        font-weight: bold;
        margin-bottom: 10px;
        }
     .info-button
     {
        margin-left: 595px;
        display:block;
        padding:5px 10px;
        text-align:center;
        width:100px;
        color: white;
        }
        .info-button a
        {
         color:White;
        }
        .ref-col1 {
        width: 100px;
        vertical-align:top;
        }
        .ref-col2 {
        width: 200px;
        vertical-align:top;
        }
        .ref-col3 {
        width: 100px;
        vertical-align:top;
        }
        .ref-col4 {
        width: 200px;
        vertical-align:top;
        }
     </style>
       
    </head>
    <body style="text-align: left;">
        <form runat="server" id="mainform">
    <div id="page">

     <div id="header">

      <div id="bar" class="primary-background-color"></div>

      <ul id="menu">

       <li id="privacy"><a href="http://forums.asp.net/t/1349824.aspx#">Privacy</a></li>

       <li id="security"><a href="http://forums.asp.net/t/1349824.aspx#">Security</a></li>

       <li id="help"><a href="http://forums.asp.net/t/1349824.aspx#">Help</a></li>

       <li id="contact-us"><a href="http://forums.asp.net/t/1349824.aspx#">Contact Us</a></li>

       <li id="log-off"><asp:LinkButton ID="linkLogOff" runat="server" onclick="linkLogOff_Click" CausesValidation="False">Log Off</asp:LinkButton></li>

      </ul>

      <img src="../MasterImages/logo.jpg" width="174" height="65" alt="Logo" id="logo" />

      <span id="portal-name" class="primary-font-color">WEB PORTAL</span>
     </div>
     <div id="main">
      <table cellspacing="0" cellpadding="0" id="two-column">
       <tbody>
        <tr>
         <td class="left primary-background-color">
          <div id="navigation-box" class="primary-background-color">
           <div id="navigation">
                               <uc1:Accordion ID="Accordion1" runat="server" />

                          </div>

          </div>

          &nbsp;

         </td>

         <td class="right">

          <div id="content">

                              <asp:ContentPlaceHolder ID="shellContent" runat="server">
                              </asp:ContentPlaceHolder>

          </div>

         </td>

        </tr>

       </tbody>

      </table>

     </div>

     <div id="footer">

      <img src="../MasterImages/poweredbycpr.jpg" width="93" height="11" alt="Poweredbycpr" id="powered" />

     </div>
    </div>
        </form>
    </body>
    </html>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 19, 2008 11:57 AM
  • User-1592694395 posted

    I loaded your sample project.  It gives the same build error:

    Validation (CSS 2.0): '<%=' is not a valid value for the 'color' property.

    But I can veiw the page in the browser even though it has build errors.

    My page will not load or run. It gives the Validation build errors, and also error:

    Could not load type 'Master_MasterShell'

     

    Wednesday, November 19, 2008 12:23 PM
  • User815882678 posted

    I loaded your sample project.  It gives the same build error:

    Validation (CSS 2.0): '<%=' is not a valid value for the 'color' property.

    But I can veiw the page in the browser even though it has build errors.

    My page will not load or run. It gives the Validation build errors, and also error:

    Could not load type 'Master_MasterShell'

     

    Just to be sure, I retested my code and it works fine with no build errors.

    Wednesday, November 19, 2008 12:35 PM
  • User-1592694395 posted

    Got me.  It doesn't seem to want to work in my environment.  Thanks for your help....

    Wednesday, November 19, 2008 1:45 PM