By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,704 Members | 1,122 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,704 IT Pros & Developers. It's quick & easy.

Displaying two pages that are identical apart from the stylesheetbeing used

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.