views:

162

answers:

2

Hi,

I'm using Visual Studio 2008 making an ASP.NET page. In this page I'm using a stylesheet at styles/basic.css

When I hit F5 to load the page it loads perfectly fine. Inside the style sheet I have defined a .basic style class along with other classes. But when I use body class="basic", Visual Studio tells me "The class or CssClass value is not defined."

I've tried to name it body.basic, I've tried renaming basic to a variety of other names, with and without body, but visual studio continues to lie to me and I can't figure out why!

Anyone else come across this/know how to fix it? I noticed one thing - I can use another class name I have: div.opaque, and VS doesn't tell me it's undefined even though it's clearly not a body class? Also I tried renaming it div.basic but that didn't work either.

A: 

Well, my current workaround is to just remove the class parameter from the body and just declare body{} in the CSS. Pesky, but works.

Wayne Werner
A: 

I often notice that if you declare the class in the head via <style type="text/css"></style> it will recognize it - classes that are in a linked stylesheet will often be problematic and it will show as undefined.

Also from my experience VS intellisense and validation works pretty slow (might be pc performance related) and it often takes him more than 30-1min to actually recognize everything in an open document.

I wouldn't bother with it anyway - it's not that all classes are always defined in css.

easwee