Wrox Programmer Forums
|
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
 
Old February 22nd, 2009, 10:46 AM
Authorized User
 
Join Date: Jan 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
Default 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?
 
Old February 22nd, 2009, 10:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
havardoj (March 5th, 2009)
 
Old February 22nd, 2009, 11:28 AM
Authorized User
 
Join Date: Jan 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
Default

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.
 
Old February 22nd, 2009, 11:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
havardoj (March 5th, 2009)
 
Old February 22nd, 2009, 04:18 PM
Authorized User
 
Join Date: Jan 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
Default

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.
 
Old February 22nd, 2009, 04:31 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
havardoj (March 5th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14 Code page 620, help needed! Safi BOOK: Beginning ASP 3.0 3 December 8th, 2010 12:43 PM
Chapter 14 example pkumar@ech BOOK: Professional Jakarta Struts 0 November 15th, 2006 09:10 AM
Chapter 14 page 580 Problems with example john_reeve41 BOOK: Beginning ASP 3.0 3 February 4th, 2004 10:21 AM
Chapter 14 Mike Smith BOOK: Professional C#, 2nd and 3rd Editions 2 January 4th, 2004 05:13 PM
Chapter 14 Page 780-781 JonR BOOK: Professional C#, 2nd and 3rd Editions 0 August 11th, 2003 08:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.