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 947631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:06:38+00:00 2026-05-15T23:06:38+00:00

I know that people have had some trouble with undefined CssClass values when using

  • 0

I know that people have had some trouble with undefined CssClass values when using partial classes in ASP.NET MVC. My project is not MVC, however, and I am including a .css file that is in the root folder of my project, yet a referenced class value still results in a warning in VS 2008.

In my .aspx file:

<html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <!-- ... -->
        <link media="all" href="~MyStyles.css" type="text/css" rel="stylesheet" />
    </head>
    <body id="bodyTag" vlink="#666666" alink="#666666" link="#666666" bgcolor="#ffffff" leftmargin="0" topmargin="0" runat="server">
        <script type="text/javascript" language="javascript" src="~Scripts\Somecript_v1.js"></script>
        <!-- form, table ... -->
                <asp:TableRow>
                    <asp:TableCell ColumnSpan="4" CssClass="cellclass">  

Then, in the same folder as the .aspx, in “MyStyles.css”, I have defined:

.cellclass
{
    border-right: #aeaeae 1px solid;
    border-top: #aeaeae 1px solid;
    font-weight: normal;
    font-size: 11px;
/* etc. */  

Yet I get the warning, “The class or CssClass value is not defined”.

  • 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-15T23:06:39+00:00Added an answer on May 15, 2026 at 11:06 pm

    Your problem is with this line:

    <link media="all" href="~MyStyles.css" type="text/css" rel="stylesheet" />
    

    You cannot use the ~ syntax in non runat="server" controls. You can’t use it in link or script tags anyway. So your href should look like:

    <link media="all" href="MyStyles.css" type="text/css" rel="stylesheet" />
    

    For security, in case you move the file aspx file later you would be advised to include the full path from the root of the website starting with a / e.g. /MyFolder/MyStyles.css

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know a bunch of people that are really enjoying the improvements that ASP.NET
So I have an ASP.NET MVC 3 website that allows people to advertise certain
I know that most people have DirectX9-capable cards but is it really necessary to
I know that a lot of people on the Internet have expressed having problems
People familiar with Homographies will know that you have to normalize it dividing by
Do you consider .NET to have multiple inheritance? Why? Yes, I know that by
I'm sure that all of us have had to deal with telecommuters at some
Looking for some practical advice here and any experiences people have had in a
It seems that a lot of small business people have a need for some
I know that most people say, OH! It's not possible, use php or whatever...

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.