Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Displaying two pages that are identical apart from the stylesheetbeing used

Reply
Thread Tools

Displaying two pages that are identical apart from the stylesheetbeing used

 
 
Mr Flibble
Guest
Posts: n/a
 
      06-21-2006
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.
 
Reply With Quote
 
 
 
 
John Timney \(MVP\)
Guest
Posts: n/a
 
      06-21-2006
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" <(E-Mail Removed)> wrote in message
news:e7bpbo$1rsk$(E-Mail Removed)...
>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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Two identical Strings stored in two different object Neroku Java 12 02-12-2007 03:32 PM
I have two almost identical pages in IE, one works and the other doesn't Luminari HTML 23 02-11-2007 12:49 AM
I have two almost identical pages in IE, one works and the other doesn't Luminari Javascript 0 02-08-2007 09:52 PM
Two radio buttons, far apart =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= ASP .Net 4 03-05-2006 03:31 PM



Advertisments