Displaying two pages that are identical apart from the stylesheetbeing used

Discussion in 'ASP .Net' started by Mr Flibble, Jun 21, 2006.

  1. Mr Flibble

    Mr Flibble Guest

    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.
     
    Mr Flibble, Jun 21, 2006
    #1
    1. Advertising

  2. Re: Displaying two pages that are identical apart from the stylesheet being used

    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.css")
    End If
    End SubCant remember where I saw this but its probably what your looking
    for.

    --
    Regards

    John Timney (MVP)



    "Mr Flibble" <> wrote in message
    news:e7bpbo$1rsk$...
    >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.
     
    John Timney \(MVP\), Jun 21, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Two radio buttons, far apart

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 2, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    458
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
    Mar 5, 2006
  2. Neroku
    Replies:
    12
    Views:
    586
    Oliver Wong
    Feb 12, 2007
  3. Luminari
    Replies:
    23
    Views:
    818
    Wings
    Feb 11, 2007
  4. Luminari
    Replies:
    0
    Views:
    123
    Luminari
    Feb 8, 2007
  5. Roy Smith
    Replies:
    5
    Views:
    188
    Oscar Benjamin
    Jan 8, 2013
Loading...

Share This Page