 |
| ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.1 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
|
|
|
|

August 14th, 2003, 10:51 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Style Sheets
I am very new to the ASP.Net world though I have been in the ASP 3.0 world for many years. I know how to add style sheets in an ASP 3.0 page. I basically had an include file included in every page that had header information which included the style sheet. Since ASP.Net creates all the headers for you and does not support include files, I am not sure how to go about including a style sheet in 1 place for the site. Does anyone know how I can do this? Do I have to add it to every page I make? Since it appears in the header section, I'd probably have to type it in on all pages instead of using a user control or something. Any advice would be greatly appreciated.
Chris
__________________
Chris
|
|

August 14th, 2003, 11:11 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
If you are using standard web forms each one has it's own head tag, so you'll have to insert the CSS link into each page. Unfortunately there is no simple way to do that easier.:(
Peter
|
|

August 14th, 2003, 11:15 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Is there another option versus "standard web forms"? Can I put it in a web.Config file or the global.asax or something? I'd hate to have to type it in every page. That almost makes it not worth even using. Why would anyone want to use a style sheet if they have to type it in every page. Taking away the includes seems to me to be negative progress in the evolution of programming.
Chris
|
|

August 14th, 2003, 11:17 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Are style sheets required to be int he Head tag when using ASP.NET, or could I put them in some control I could include?
Chris
|
|

August 14th, 2003, 12:15 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Chris,
You hit the nail on the head on several points.
As of right now, there doesn't seem to be any easy way to create a site "skeleton" in .Net. Believe me, I have been working on it here and again for months. I kind of have a working method, but it's still pretty confusing and not 100% yet. Most people use the method of user controls added to the page to provide the components of the page. Unfortunately, this still means you have to add each component to each web form independently and still denies you the flexibility of a truly dynamic site. Especially when it comes to building the head of a page (I.E. common stylesheets/javascript, setting the browser title bar value, etc).
Regarding stylesheet link location: It seems that you don't have to have it in the head tag. They seem to work fine outside. This may cause some problems with other browsers. I.E. is remarkably flexible with regards to HTML, layout, styles, just about everything. Other's may not be so forgiving.
My take on this subject is that Microsoft is driving the "web/server control" model. This means basically that you need to define all of your layout and style attributes in the controls. The purpose of this is so that when a page is rendered, the framework can render it according to the device it's going to. If it's going to a standard browser, it will render it differently than if it's going to a web enabled phone. The theory being that you can create very flexible sites and applications by using the standard library of controls that adjust automatically based on the client. It's a great idea, but in the end, most of us are just trying to build web sites and want to do so efficiently.
Some hope??
There is talk of the addition of the "Master Pages" concept into the next major version of the framework. Google "Master Pages" and see what you can find on it. It seems like it's a move toward the direction you and many others are looking for. I have not used it myself, only looked over it a bit. At first glance it seems a little cumbersome, but I can't fairly judge it without having tried it yet.
Good luck!
Peter
|
|

August 14th, 2003, 01:46 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Until the Master Pages arrive, there are a few ways to do "templates" in .NET.
If you have the time and the courage, you could check out this thread at www.asp.net
It's quite long, discusses a number of concepts in (too) great detail, but it contains enough information, ideas and links to get you inspired.
Regards,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |