473,698 Members | 2,132 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 1181
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
1934
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
2072
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
5541
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
2330
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
2512
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
5119
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
5067
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
1505
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
8600
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,...
1
8892
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8860
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
7712
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
6518
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
4361
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3038
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2323
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1998
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.