473,500 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

master pages and css

Hello

I understand how master pages work with containers.

How would i go about having a stylesheet for one of my containers in a
different aspx file considering that the <headelement is in the
master file? Putting it in the master file means it will be included
for all.

once using master pages, aspx files only have this

<asp:Content ID="ContentSiteBody" ContentPlaceHolderID="SiteBody"
Runat="Server">

any help would....help :)

Aug 29 '07 #1
3 1205
On Aug 29, 8:55 am, Sir Psycho <panuccio.vi...@gmail.comwrote:
Hello

I understand how master pages work with containers.

How would i go about having a stylesheet for one of my containers in a
different aspx file considering that the <headelement is in the
master file? Putting it in the master file means it will be included
for all.

once using master pages, aspx files only have this

<asp:Content ID="ContentSiteBody" ContentPlaceHolderID="SiteBody"
Runat="Server">

any help would....help :)
you can use following technique

Style s = new Style();
s.BackColor = System.Drawing.Color.Red;
Page.Header.StyleSheet.CreateStyleRule(s, this, "BODY");

this would change the background of your content page

http://groups.google.com/group/micro...61cb0ba720710d

Aug 29 '07 #2
http://www.pluralsight.com/blogs/ted.../31/14437.aspx
"Sir Psycho" <pa************@gmail.comwrote in message
news:11*********************@l22g2000prc.googlegro ups.com...
Hello

I understand how master pages work with containers.

How would i go about having a stylesheet for one of my containers in a
different aspx file considering that the <headelement is in the
master file? Putting it in the master file means it will be included
for all.

once using master pages, aspx files only have this

<asp:Content ID="ContentSiteBody" ContentPlaceHolderID="SiteBody"
Runat="Server">

any help would....help :)

Aug 29 '07 #3
In article <_a****************@bignews3.bellsouth.net>, vMike
<Mi************@5nerrawgenospam.comwrites
>This is *much* easier than using the ASP.NET objects to modify the <head>
programmatically.

No disrespect taken. I think it depends a lot on how much flexibly you
need. If it you are trying to build an app that is going to have a lot
of flexibility, I prefer properties.
Out of interest, why? Having the <headstuff inside a content tag still
allows flexibility. I showed a static way to do it, but there's nothing
wrong with putting a Literal control in the <headcontent tag and
setting the stylesheet dynamically. Works the same as a property, but
much simpler IMO.

I'd be interested to hear why you prefer properties.

Ta ra

--
Alan Silver
(anything added below this line is nothing to do with me)
Aug 30 '07 #4

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

Similar topics

1
1614
by: Sasha | last post by:
Hi all asp.net proffesionals out there, How do you implement master pages in your applications? What libraries do you use and what have been your experience? Sasha
5
2397
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
20
2393
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the...
1
1847
by: Alan Silver | last post by:
Hello, I am just experimenting with master pages, and am trying to add a content placeholder in the <head> section, so that individual pages can set their own page title and meta tags. The...
17
3133
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
7
8688
by: xkeops | last post by:
Thinking of creating a website, most of the pages will have a general toolbar menu, a content and a footer. The content will be the only one who's gonna change but the rest (header,footer) will...
8
6661
by: JT | last post by:
Hi, I have done a fair amount of style editing inline in ASP. I'm now using VS 2005 with a standard web project (not Web Application Project). This is my first foray into CSS in a style sheet...
3
5960
by: Rich | last post by:
Hi, I want to use 2 master pages, one for the main part of the site, the other for the admin pages. They are quite similar, with many shared elements. Ideally I would like to have a parent...
13
5289
by: Kirk | last post by:
I have been reading Scott Allen's article on Master Pages (http:// odetocode.com/Articles/450.aspx) but I am having problems understanding a concept. Specifically, I have created a property...
6
1677
by: Mickey | last post by:
Coming from a Dreamweaver/ASP/PHP background. Planning to use Visual Studio 2008 for a website. Complete newbie question here (please be gentle!): Do master pages work similar to Dreamweaver...
0
7136
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
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7182
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
7397
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...
1
4923
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...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.