473,405 Members | 2,279 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,405 software developers and data experts.

Displaying two pages that are identical apart from the stylesheetbeing used

I want my site to host a Default.aspx and a Default2.aspx page with one
page being rendered using Stylesheet1.css and the other using
Stylesheet2.css. So far I've just copied Default into Default2 (cut and
paste) but this is crap because every time I need to change my site I
will need to make the changes to both Default and Default2 which are the
same page apart from the stylesheet. Clearly there is a better way in
ASP.NET to perform what must be a FAQ? Unless I remove all the HTML
generating code and put it app_code and both sites use that , but is
there a way of ridding myself of the necessity for having two pages when
really all I want is one page rendered against two different stylesheets
and presented as separate pages on my site.
Jun 21 '06 #1
1 1171
You should read up on themes in asp.net 2.0. Until you do, why dont you
dynamically set the stylesheet in default.aspx and have 1 default page, and
two stylesheets.

<head>
<link id="cssStyleSheet" rel="stylesheet" type="text/css" runat="server" />
</head>
Sub Page_Load(Sender As Object, E As EventArgs)
If Not (IsPostBack)
cssStyleSheet.Attributes.Add("href","Stylesheet1.c ss")
End If
End SubCant remember where I saw this but its probably what your looking
for.

--
Regards

John Timney (MVP)

"Mr Flibble" <mr********@flibbyly.wobbly.n.et> wrote in message
news:e7***********@custnews.inweb.co.uk...
I want my site to host a Default.aspx and a Default2.aspx page with one
page being rendered using Stylesheet1.css and the other using
Stylesheet2.css. So far I've just copied Default into Default2 (cut and
paste) but this is crap because every time I need to change my site I
will need to make the changes to both Default and Default2 which are the
same page apart from the stylesheet. Clearly there is a better way in
ASP.NET to perform what must be a FAQ? Unless I remove all the HTML
generating code and put it app_code and both sites use that , but is
there a way of ridding myself of the necessity for having two pages when
really all I want is one page rendered against two different stylesheets
and presented as separate pages on my site.

Jun 21 '06 #2

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

Similar topics

4
by: Klaus Neuner | last post by:
Hello, the function given below returns all indexes of list2 where a sublist of list2 that is identical to list1 begins. As I will need this function quite often, I would like to know if more...
5
by: Mystery | last post by:
Can anyone point me to a script that will allow me to list x number of records per page and give me a page selector and information like the one in the subject header? Thanks.
5
by: Murphy | last post by:
I have read the articles by Paul Wilson regarding master pages, and apart from being totally confused I would like to clarify the following before investing any further time on researching these...
9
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash...
4
by: Paul | last post by:
I have a few pages written using only Divs and css stylesheets, however, they appear very differently in IE 6 and in Firefox 1.5.0.1. Is there a program that will take the code for one browser and...
9
by: Andrew Kidd | last post by:
Hi, I've just been working through several examples of how to create Master pages and then create content pages which are linked, but I cannot see the Master page when I'm viewing the content...
3
by: hestres | last post by:
Hello, I'm working on some link styles for this page: http://www.house.gov/velazquez/lh0205tres/reports.html I want all the links to always display in red (#CC0000), but in IE6 and 7 they...
38
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
7
by: Jonathan Wood | last post by:
Okay, I have a site that displays information based on user input, a couple of the items are plain strings that the user entered. I understand the risk here is that they could insert javascript...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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,...

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.