473,722 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1184
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="cssStyleShe et" rel="stylesheet " type="text/css" runat="server" />
</head>
Sub Page_Load(Sende r As Object, E As EventArgs)
If Not (IsPostBack)
cssStyleSheet.A ttributes.Add(" href","Styleshe et1.css")
End If
End SubCant remember where I saw this but its probably what your looking
for.

--
Regards

John Timney (MVP)

"Mr Flibble" <mr********@fli bbyly.wobbly.n. et> wrote in message
news:e7******** ***@custnews.in web.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
1935
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 experienced programmers would agree with the way I defined the function: - Is there a more efficient way to do it? (Apart from building
5
2074
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
290
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 concepts. Are master pages reliable or are they a buggy concept ? I understand master pages will be included in the next version of the framework ? Is there a reason not to use them presently ? Where can I obtain further documentation of the...
9
5546
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 shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
4
2332
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 convert it into code that will have a similar appearance in another browser? I am using Visual Studio 2005 but own Dreamweaver too... . TIA, Paul
9
2514
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 page in "Design", nor do I see it when I'm viewing the page in the browser. I'm adding the Master page through the Add New Item dialog, and creating Web Forms with the "Select Master Page" option checked, then selecting the Master page from the...
3
5120
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 display in gray. In FF and Opera they work fine. I've looked all over the code and can't find what might be causing this. Is it an IE quirk I don't know about? Thanks,
38
5071
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
1507
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 or whatever in their string and, when my page displays it, that script could be executed. What is the best approach for preventing that? Thanks.
0
8863
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9384
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9088
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8052
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6681
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2602
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2147
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.