Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 26th, 2009, 04:03 AM
Authorized User
Points: 297, Level: 5
Points: 297, Level: 5 Points: 297, Level: 5 Points: 297, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #2 (permalink)  
Old April 26th, 2009, 04:14 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #3 (permalink)  
Old April 26th, 2009, 05:45 AM
Authorized User
Points: 297, Level: 5
Points: 297, Level: 5 Points: 297, Level: 5 Points: 297, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #4 (permalink)  
Old April 26th, 2009, 05:54 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 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..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:53 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.