Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Dynamically loading stylesheets

Reply
Thread Tools

Dynamically loading stylesheets

 
 
=?Utf-8?B?QWxhbiBMYW1iZXJ0?=
Guest
Posts: n/a
 
      11-23-2004
I have an ASP.Net page which, depending on a parameter being passed via the
QueryString, needs to use a different stylesheet.

I've tried creating a runat="server" version of the link tag:

<link rel="stylesheet" type="text/css" href="" id="pageStyle" runat="server"

and then accessing it via code:

Select Case Request.QueryString("page")
Case "whiteboard"
pageStyle.href= "whiteboard.css"
Case ...
End Select

but this doesn't work.

How should I go about acheiving this?

Many thanks for any any help

Alan
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      11-23-2004
Alan,

Amongst a number of ways of doing that the most common one is adding a
literal control to the <head> section and setting it's text in code-behind
to <link...>.

Eliyahu

"Alan Lambert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have an ASP.Net page which, depending on a parameter being passed via

the
> QueryString, needs to use a different stylesheet.
>
> I've tried creating a runat="server" version of the link tag:
>
> <link rel="stylesheet" type="text/css" href="" id="pageStyle"

runat="server"
>
> and then accessing it via code:
>
> Select Case Request.QueryString("page")
> Case "whiteboard"
> pageStyle.href= "whiteboard.css"
> Case ...
> End Select
>
> but this doesn't work.
>
> How should I go about acheiving this?
>
> Many thanks for any any help
>
> Alan



 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWxhbiBMYW1iZXJ0?=
Guest
Posts: n/a
 
      11-23-2004
Worked perfectly.

Many thanks.

Alan

"Eliyahu Goldin" wrote:

> Alan,
>
> Amongst a number of ways of doing that the most common one is adding a
> literal control to the <head> section and setting it's text in code-behind
> to <link...>.
>
> Eliyahu
>
> "Alan Lambert" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I have an ASP.Net page which, depending on a parameter being passed via

> the
> > QueryString, needs to use a different stylesheet.
> >
> > I've tried creating a runat="server" version of the link tag:
> >
> > <link rel="stylesheet" type="text/css" href="" id="pageStyle"

> runat="server"
> >
> > and then accessing it via code:
> >
> > Select Case Request.QueryString("page")
> > Case "whiteboard"
> > pageStyle.href= "whiteboard.css"
> > Case ...
> > End Select
> >
> > but this doesn't work.
> >
> > How should I go about acheiving this?
> >
> > Many thanks for any any help
> >
> > Alan

>
>
>

 
Reply With Quote
 
=?Utf-8?B?UGF0cmljay5PLklnZQ==?=
Guest
Posts: n/a
 
      11-24-2004
Hi Alan...
Can you POST the code how u did it!
Thanks


"Alan Lambert" wrote:

> Worked perfectly.
>
> Many thanks.
>
> Alan
>
> "Eliyahu Goldin" wrote:
>
> > Alan,
> >
> > Amongst a number of ways of doing that the most common one is adding a
> > literal control to the <head> section and setting it's text in code-behind
> > to <link...>.
> >
> > Eliyahu
> >
> > "Alan Lambert" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > I have an ASP.Net page which, depending on a parameter being passed via

> > the
> > > QueryString, needs to use a different stylesheet.
> > >
> > > I've tried creating a runat="server" version of the link tag:
> > >
> > > <link rel="stylesheet" type="text/css" href="" id="pageStyle"

> > runat="server"
> > >
> > > and then accessing it via code:
> > >
> > > Select Case Request.QueryString("page")
> > > Case "whiteboard"
> > > pageStyle.href= "whiteboard.css"
> > > Case ...
> > > End Select
> > >
> > > but this doesn't work.
> > >
> > > How should I go about acheiving this?
> > >
> > > Many thanks for any any help
> > >
> > > Alan

> >
> >
> >

 
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
CSS stylesheets not loading in IE or firefox on XP SP2 Rschen7754 Computer Support 6 09-18-2009 02:22 PM
loading a single xml file with different stylesheets jim XML 1 07-24-2007 04:36 AM
switching stylesheets dynamically.. maya Javascript 5 02-01-2007 09:56 PM
Changing stylesheets Adrian ASP .Net 1 10-27-2003 04:49 PM
Loading different stylesheets for different browsers Andries HTML 5 09-09-2003 07:47 AM



Advertisments