 |
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
 | This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

February 22nd, 2009, 10:46 AM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
Chapter 14 - Warnings on page 484
Hi,
I am able to complete the Try It Out that starts on 482, but I get six of these warnings:
Warning 3 The class or CssClass value is not defined. C:\BegAspNet\Site\App_Themes\Management\GridView.s kin 3 26 C:\BegAspNet\Site\
My GridView.skin looks like this:
<asp:GridView runat="server" CssClass="GridView">
<AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
<HeaderStyle CssClass="GridViewHeaderStyle" />
<PagerStyle CssClass="gridViewPagerStyle" />
<EditRowStyle CssClass="GridViewEditRowStyle" />
</asp:GridView>
The Management.css is too big to paste here, but it seems to be written according to the description in the try it out.
I can't see where I have gone wrong. The way I look at it, I have followed the try it out completely.
But I have probably missed something?
Can anyone give me a clue on what's wrong?
By the way, the web page looks fine, so it can it be a bug in VWD?
|
|

February 22nd, 2009, 10:52 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
But I have probably missed something?
|
Yes, the explanation in step 3 on page 482. Quote from the book:
Quote:
|
Donât worry if VWD adds red error lines under the CSS class names. Since the CSS classes arenât defined yet, it canât find them. Later you will add them to the themeâs CSS file, where VWD still canât find them. Theyâll work fine at run time, though, so donât worry.
|
Visual Web Developer doesn't know what theme will be applied at run-time, so it's not able to see the relation between the CssClass in the Skin file and the actual CSS selectors in the CSS file.
It's just a warning though, which you can safely ignore.
Cheers,
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

February 22nd, 2009, 11:28 AM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
Thanks for replying!
I saw this explanation, but I thought I had solved this problem in step 6?
If it comes in a later try it out, it's ok. And as you said, it looks as if the warnings can be ignored.
Hmmm... I think there is something fundamentally and obvious that I don't understand yet:
Quote:
|
Visual Web Developer doesn't know what theme will be applied at run-time, so it's not able to see the relation between the CssClass in the Skin file and the actual CSS selectors in the CSS file.
|
But I will probably have an "Eureka!" moment an time soon. 
|
|

February 22nd, 2009, 11:51 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
The "problem" with skins is that the skin file itself doesn't know where it's going to be used. It's just a file with some design definitions for controls that is applied at run-time. The theme applied at run-time is responsible for setting the right skin.
I guess VWD could look at all the CSS files defined in the theme's folder that also holds the skin so it knows what CSS classes are available, but that's not how it's currently implemented in VWD 2008.
What happens when you change the theme to Management in web.config like this:
<pages theme="Management">
VWD shoud then pick up the CSS definitions defined in the Management theme; at least in regular ASPX files. Don't forget to change it back again or all your pages will use the Management theme.
I tried reproducing the errors in the skin file but they no longer show up for me. Maybe the behavior has been changed in Service Pack 1 for VWD? Did you apply that service pack?
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

February 22nd, 2009, 04:18 PM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
Hi again,
I start with answering you latest question:
Yes, I am already running SP1 of VWD express. But I can't rule out the possibility that I have overlooked one or more errors somewhere in my site.
I have worked many years as a software tester, and I don't like leaving warnings like this. Having said that, this is obviously not the biggest error to spend time trying to resolve...
Thanks for taking time to look into this, I appreciate that very much! And thanks for explaining about skins and run-time.
By the way, I see that VWD sometimes reports one or more errors in my site. But when I save the solution, double in the error list or "Go to definition" for a reported missing definition --> Errors disappears. I just mentioned this, and if I'm not the only one that has experienced it, please let me know.
|
|

February 22nd, 2009, 04:31 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
They are not true errors / warnings. It's just VWD's way of saying: "I can't determine where the classes you are referring to are defined, so I can't check whether they are valid or not. Make sure that you check the validity".
That's all; not more. Fortunately they go away if you close the page so they're not bothering you when you're working with other pages (unlike true errors and warnings like a C# compiler warnings which won't go away).
With regards to the error disappearing: sometimes VWD is slow with updating the error list, so maybe you're just looking at an old message with no associated error?
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|
 |