473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Styles - general question

What's the generally accepted approach for using Styles and Stylesheets in a
web application based on .aspx files, Web Controls, User Controls, and
code-behind modules (c# in my case)? Most style and stylesheet guides on the
internet seem to be based on web sites (rather than applications) based on
relatively static textual information.

I have read that external stylesheet files are the way to go, but it seems
to me that these only lend themselves to defining "generic" styles shared by
all your pages, whereas page-specific settings (such as the position of each
item on the page) are most easily embedded directly into your .aspx pages as
in-line styles - but then you lose all the benefits of true separation
right? (maintainability, scalability, accessibility, etc).

It seems to me too cumbersome to separate such positioning of individual
items into page-specific stylesheet files - I'd have to define one class per
page control and then link the control to the class, correct?

Are there any guidelines available on this ? Could anyone point me in the
right direction ?


Nov 18 '05 #1
3 1455
This is just a general guideline (style separation) but in this particular
case, you won't loose that much IMO as changing the position of a control
would be anyway a change for just a single control (even if the style is an
external style sheet) opposed to a change of style that could apply to most
of the pages. AFAIK ASP.NET stores the position at the control level in
gridlayout mode.

What count IMO is the *usage* you'll have for the style. For example if a
position is used in a single page for a single control, its likely best tied
to this control. If a position is shared by multiple controls on various
pages, it could go into an external style sheet.

As a side note my personal preference is not to use absolute positionning
unless stricly needed...

Patrice

"JezB" <je**@somewhere.com> a écrit dans le message de
news:%2****************@tk2msftngp13.phx.gbl...
What's the generally accepted approach for using Styles and Stylesheets in a web application based on .aspx files, Web Controls, User Controls, and
code-behind modules (c# in my case)? Most style and stylesheet guides on the internet seem to be based on web sites (rather than applications) based on
relatively static textual information.

I have read that external stylesheet files are the way to go, but it seems
to me that these only lend themselves to defining "generic" styles shared by all your pages, whereas page-specific settings (such as the position of each item on the page) are most easily embedded directly into your .aspx pages as in-line styles - but then you lose all the benefits of true separation
right? (maintainability, scalability, accessibility, etc).

It seems to me too cumbersome to separate such positioning of individual
items into page-specific stylesheet files - I'd have to define one class per page control and then link the control to the class, correct?

Are there any guidelines available on this ? Could anyone point me in the
right direction ?

Nov 18 '05 #2
I can only tell what approach do I use.

I have a general default.css on my app root. This file defines:
- general styles for HTML elements (like BODY, TD, A, etc. tags)
- style classes for controls that use the same layout (like .generalForm,
..textTitle, .subTitle etc.) with child tag/class definitions for automatic
style formatting within those controls

all styles that are like Web User Control specific are written within
controls ascx file. Maintainability in this case is not a problem, while
only that control uses some special style.

But if you really make a very well defined UI design layout you will
probably rarely find a usercontrol that should use specific styles.

On general html tag classes define just the general things like font, color,
etc. and then override or "add" other styles with style classes with child
dependence... So far I've never heard about any complaint regarding
maintainability of any of my colleges in development department.

--
RobertK
{ Clever? No just smart. }
"JezB" <je**@somewhere.com> wrote in message
news:#Q**************@tk2msftngp13.phx.gbl...
What's the generally accepted approach for using Styles and Stylesheets in a web application based on .aspx files, Web Controls, User Controls, and
code-behind modules (c# in my case)? Most style and stylesheet guides on the internet seem to be based on web sites (rather than applications) based on
relatively static textual information.

I have read that external stylesheet files are the way to go, but it seems
to me that these only lend themselves to defining "generic" styles shared by all your pages, whereas page-specific settings (such as the position of each item on the page) are most easily embedded directly into your .aspx pages as in-line styles - but then you lose all the benefits of true separation
right? (maintainability, scalability, accessibility, etc).

It seems to me too cumbersome to separate such positioning of individual
items into page-specific stylesheet files - I'd have to define one class per page control and then link the control to the class, correct?

Are there any guidelines available on this ? Could anyone point me in the
right direction ?

Nov 18 '05 #3
Thanks group, this was what I was after. Although I understood the
possibilities it was difficult for me to see what would work best in
practice, not having ever built a real-world ASP.NET application.

"JezB" <je**@somewhere.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
What's the generally accepted approach for using Styles and Stylesheets in a web application based on .aspx files, Web Controls, User Controls, and
code-behind modules (c# in my case)? Most style and stylesheet guides on the internet seem to be based on web sites (rather than applications) based on
relatively static textual information.

I have read that external stylesheet files are the way to go, but it seems
to me that these only lend themselves to defining "generic" styles shared by all your pages, whereas page-specific settings (such as the position of each item on the page) are most easily embedded directly into your .aspx pages as in-line styles - but then you lose all the benefits of true separation
right? (maintainability, scalability, accessibility, etc).

It seems to me too cumbersome to separate such positioning of individual
items into page-specific stylesheet files - I'd have to define one class per page control and then link the control to the class, correct?

Are there any guidelines available on this ? Could anyone point me in the
right direction ?

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christopher Benson-Manica | last post by:
Just FMI, if an external stylesheet is linked to a page (with <link>), will subsequent <style> tags override the values in the external stylesheet? -- Christopher Benson-Manica | I *should*...
7
by: codeslayer | last post by:
Greetings to everyone in ‘forum-land': I have a problem that has plaguing me to no end. It is a CSS-related question, and I have not seen this question posted anywhere in forums or through...
17
by: TheKeith | last post by:
Isn't there a style for preformatted text, instead of having to use the pre tags? Help would be appreciated--thanks.
8
by: Ryan Stewart | last post by:
Is there a way to reset the style property of an HTML element to some default or to all empty values? I have a group of elements whose style settings may be changed arbitrarily at certain points in...
12
by: dan.vendel | last post by:
Hi, I know nothing about javascript, but quite a lot about regulat html and CSS. Have bumped into a problem that people in this fine congregation perhaps can help me with. I'm making a...
1
by: Eric Lindsay | last post by:
I am trying to understand the differences between and uses of persistent, default and alternate styles. I have read http://www.w3.org/TR/REC-html40/present/styles.html section 14.3.2 on...
5
by: Viken Karaguesian | last post by:
Hello all, It seems to me that IE ignores other styles altogether when an inline style is used. As an example, check my site (in my signature file). In the "Latest News and Headlines" you can...
16
by: Giggle Girl | last post by:
Hi there, I have a nav tree similar to the XP Windows Explorer in behavior. It uses styles to underline a row on mouseover, and change the look of a row when clicked. Currently, it is working...
6
by: Goofy | last post by:
Hi People, Just wondered how you guys deal with the complex issue of CSS Styles for Complex server controls like the GridView. I know its a breeze to set up the styles for AlternatingRowStyles...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.