views:

37

answers:

2

I've seen this in a webcast somewhere, but I can't remember where, and all searching terms I'm trying are coming up unhelpful.

I've got a stylesheet for my site, and it's referenced in a master page. Child pages that use this master page use these styles, but .Net doesn't know about them. When the site is run, it all works great, but I'm trying to figure out how to get .Net to know about them at design time.

This should also fix the issue with not knowing about the javascript files I'm including, too -- I think it's all related and I can't for the life of me figure out how.

EDIT: I'm an idiot. This is the code that was being used to include the stylesheet.

<link href="<%= ResolveUrl("~/") %>css/styles.css" rel="stylesheet" type="text/css" />

I hate people who overthink things. Oh, and people who are too stupid to fully investigate an issue before they ask a question. Like me.

A: 

I think it's just a limitation of Visual Studio's designer. It can't know all of the possible combinations of master pages/child pages, so it just seems to be a bit pessamistic at times. I wouldn't worry about it.

Dean Harding
I could have sworn that there was some kind of directive you could use to make it not complain about this stuff. I mean, I've got 1 masterpage, 1 page that uses that as its master, and 1 stylesheet that is clearly linked in the master page. It's not rocket surgery. :)
Matt Dawdy
it's not rocket surgery, pls see my answer. Hope it helps.
SoftwareGeek
+1  A: 

You can try using View->Manage Styles which brings up a list of the css that you can use in your pages at design time.

UPDATE: Actually how are you creating your child page? I just noticed that i have complete access to stylesheet classes that are referenced in master page.

I created child page as 'web content form' & then specified the master page. Then in my child page when i try to add cssclass to a label, it gives me a list of styles from the stylesheet referenced in master page.

SoftwareGeek
Okay, you are right. I wasn't paying enough attention to the code that I copied. The code of the masterpage that included the css file is this:<link href="<%= ResolveUrl("~/") %>css/styles.css" rel="stylesheet" type="text/css" /> Seems like overkill to me, but maybe they had a reason. This is most likely the reason why the javascript doesn't give me much intellisense except for the generic built in stuff.
Matt Dawdy