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 April 26th, 2009, 04:03 AM
Authorized User
 
Join Date: Apr 2009
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 10: Referencing CSS issue

Hello,
I have typed in the code from Chapter 10 however the ContactForm.ascx is not referencing the styles in the DarkGrey and Monochrome Theme. In the srop down box for typing the code in ContactForm.ascx it only shows a style1, style2, style3 option but doesn't reference any of the other styles programmed either. It doesn't seem to be referencing the the CSS at all.

THanks in advance..

Tomche
 
Old April 26th, 2009, 04:14 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

What "styles in the DarkGrey and Monochrome Theme" are you talking about? The PleaseWait style? And isn't it being applied at run-time in the browser or at development time in VWD?

Since the code is inside a User Control (ContactForm.ascx) VWD doesn't know in which page it's going to be used and as such cannot pick up layout / styles from a Master Page or a Theme. This means you won't get IntelliSense for styles defined in one of the themes folders.

At run-time, the proper theme should be applied, so classes like PleaseWait get effective.

Hope this helps,

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!
 
Old April 26th, 2009, 05:45 AM
Authorized User
 
Join Date: Apr 2009
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Imar,
The monochrome theme and the dark grey theme work at runtime.

At Development Time the ContactForm.ascx can't see anystyles from either the Monochrome or Dark Grey Theme. All it can see are generic styles "style 1" "style 2" etc.

How does one tell VWD to reference a certain theme whilst editing a user control?

Thanks

Tomche
 
Old April 26th, 2009, 05:54 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Tomche,

By design, there's no official way to do it. Like I said earlier, since User Controls can be used anywhere, including pages that have their own theme set, overriding anything set at web.config level, there really is no way for VWD to tell what theme it should look for and apply.

However, you can simply add a <link /> reference to one of your stylesheets in the UC. Add this to your User Control, for example right before or after the embedded <style> element
Code:
<link href="../App_Themes/DarkGrey/DarkGrey.css" rel="stylesheet" type="text/css" />
Now you'll get IntelliSense in the UC. The downside of this is that the file also ends up in the browser. possibly messing with your other styles. To stop that from happening, wrap the <link /> element in a pair of server side comment tags. VWD still sees the reference, but the link won't end up in your browser:
Code:
<%--<link href="../App_Themes/DarkGrey/DarkGrey.css" rel="stylesheet" type="text/css" />--%>
Hope this helps,

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!

Last edited by Imar; April 26th, 2009 at 07:45 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance issue while forming a tree for 10 MB X prathap_u XML 2 August 9th, 2008 04:06 AM
CSS Instant Results: Project 6 & 10 ericcutty BOOK: CSS Instant Results 1 October 11th, 2007 08:45 AM
CSS style issue ok in Firefox but not in IE6 socoolbrewster CSS Cascading Style Sheets 1 September 22nd, 2006 10:01 AM
Chapter 10 charedit.php issue luke adamis BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 January 1st, 2006 06:28 PM
CSS layout issue Groundhog1248 CSS Cascading Style Sheets 1 March 2nd, 2005 09:13 AM





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