473,406 Members | 2,293 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.

best way to programatically set a page's style?

PJ6
Instead of putting something like this in the page's HTML

<LINK rel="stylesheet" type="text/css" href="..\Styles.css" />

I would like to be able to have the page set its style at runtime from the
code behind. Is it possible to do this in an OO way - that is, not have to
get your fingers into the <HEAD> area "control" and manually add a LINK tag
there?

Paul
Nov 19 '05 #1
4 1025
Do you mean like Erika does ?

http://www.dotnettreats.com/samplethemes/Default.aspx

You can download/adapt her sample code.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"PJ6" <no****@nowhere.net> wrote in message news:eA**************@TK2MSFTNGP10.phx.gbl...
Instead of putting something like this in the page's HTML

<LINK rel="stylesheet" type="text/css" href="..\Styles.css" />

I would like to be able to have the page set its style at runtime from the code behind.
Is it possible to do this in an OO way - that is, not have to get your fingers into the
<HEAD> area "control" and manually add a LINK tag there?

Paul

Nov 19 '05 #2
PJ6
I don't have 2.0 yet...
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP12.phx.gbl...
Do you mean like Erika does ?

http://www.dotnettreats.com/samplethemes/Default.aspx

You can download/adapt her sample code.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"PJ6" <no****@nowhere.net> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
Instead of putting something like this in the page's HTML

<LINK rel="stylesheet" type="text/css" href="..\Styles.css" />

I would like to be able to have the page set its style at runtime from
the code behind. Is it possible to do this in an OO way - that is, not
have to get your fingers into the <HEAD> area "control" and manually add
a LINK tag there?

Paul


Nov 19 '05 #3
Then you'll have to add the <link rel...> tag.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"PJ6" <no****@nowhere.net> wrote in message news:OI*************@TK2MSFTNGP10.phx.gbl...
I don't have 2.0 yet...
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP12.phx.gbl...
Do you mean like Erika does ?

http://www.dotnettreats.com/samplethemes/Default.aspx

You can download/adapt her sample code.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"PJ6" <no****@nowhere.net> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
Instead of putting something like this in the page's HTML

<LINK rel="stylesheet" type="text/css" href="..\Styles.css" />

I would like to be able to have the page set its style at runtime from the code
behind. Is it possible to do this in an OO way - that is, not have to get your fingers
into the <HEAD> area "control" and manually add a LINK tag there?

Paul



Nov 19 '05 #4
Well sisnce you don't have ASP.NET 2.O yet then u can use sessions or
cookies..
Look through :-
http://www.brainjar.com/asp/schemes/
Hope that helps
Patrick
"PJ6" <no****@nowhere.net> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
Instead of putting something like this in the page's HTML

<LINK rel="stylesheet" type="text/css" href="..\Styles.css" />

I would like to be able to have the page set its style at runtime from the
code behind. Is it possible to do this in an OO way - that is, not have to
get your fingers into the <HEAD> area "control" and manually add a LINK tag there?

Paul

Nov 19 '05 #5

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

Similar topics

16
by: Jonas Smithson | last post by:
I'm going to say something now that may seem to completely contradict a previous post of mine, in which I basically said that taking a "who cares" attitude about certain browsers (because of their...
3
by: Gil | last post by:
Hello, I use VB.NET and have a series of linkbuttons that are inside individual <td>s. Like this: <td background="image.gif"><asp:linkbutton id="myID" runat="server"/></td> I would like...
1
by: alvinpoon | last post by:
Hello, I have a problem setting the scrollbar position of a div region on a webpage which is posted at http://www.geocities.com/virtuosity999/Logon.htm If the page is loaded with Netscape,...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
3
by: desmcc | last post by:
I know how to programatically add a text field to a web page. What I don't know is how to adjust the position of any controls below the one I am adding. (The page layout is grid layout). There...
9
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT...
8
by: Rak | last post by:
I am looking for a way to programatically change the .net version of the virtual directory that I am creating within a aspx page. As part of creating a new customer in my asp.net 2 application, it...
1
by: jaybob217 | last post by:
Is there a way to set a labels background image programatically from the code behind page? I've played around with "style background-image: url()" but can't seem to get it to work. Label.Style
7
by: The Mad Ape | last post by:
Hi I have code to programatically create a label. It works but when I try to call a sub to create a tooltip it does not work. I do not get an error so have no idea what it wrong. Please review...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.