css - CssClass value not found for non-MVC ASP.NET form -
I know that while using partial classes in ASP.NET MVC, people have some problems with the undefined CssClass value . My project is not MVC, though, and I have a Includes CSS file which is in the original folder of my project, yet a referenced square value is still a result in VS 2008 warning.
Aspx file in me:
& lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Head runat = "server" & gt; & Lt ;! - ... - & gt; & Lt; Link media = "all" href = "~ MyStyles.css" type = "text / css" rel = "stylesheet" /> & Lt; / Head & gt; & Lt; Body id = "bodyTag" vlink = "# 666666" alink = "# 666666" link = "# 666666" bgcolor = "# ffffff" leftmargin = "0" topmargin = "0" runat = "server" & gt; & Lt; Script type = "text / javascript" language = "javascript" src = "~ scripts \ somecript_v1.js" & gt; & Lt; / Script & gt; & Lt ;! - Forms, tables ... - & gt; & Lt; ASP: TableRow & gt; & Lt; Asp: tableclay columnspace = "4" CssClass = "cell class" & gt;
Then, in the same folder as .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 * /
Still I get a warning, "Class or CSS class value is not defined".
Your problem is with this line:
You can not use the ~
syntax in the non runat = "server"
Code> or script
tags. So your href
should look like this:
& lt; Link media = "all" href = "MyStyles.css" type = "text / css" rel = "stylesheet" / & gt;
For security, if you move the file aspx file later, you will be advised that you get started with the root of the website starting with /
Include the complete route. / MyFinder / MyStyle CSS
Comments
Post a Comment