Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Adding style sheet dynamicaly

Reply
Thread Tools

Adding style sheet dynamicaly

 
 
Marc Nederhoff
Guest
Posts: n/a
 
      11-05-2003
Hi all,

Is it possible to add the <link rel="stylesheet"....> dynamicaly. All pages
in my site use the same style sheet, and I don't want to add the link
manualy because of maintenance.

Marc


 
Reply With Quote
 
 
 
 
Janaka
Guest
Posts: n/a
 
      11-05-2003
There's no stylesheet control i'm aware of otherwise that would be the best
option.
I'd say you can either do one of two options
1. Create a Literal control and set the text to equal "<link
rel=\"stylesheet\" src=\"" + stylesource + \"">" at runtime
2. Set a variable in your Page_Load event and then bind or write this to
your link tag. <link rel="stylesheet" src="<%= stylesource%>">

"Marc Nederhoff" <> wrote in message
news:boaj4o$68l$...
> Hi all,
>
> Is it possible to add the <link rel="stylesheet"....> dynamicaly. All

pages
> in my site use the same style sheet, and I don't want to add the link
> manualy because of maintenance.
>
> Marc
>
>



 
Reply With Quote
 
 
 
 
charles
Guest
Posts: n/a
 
      11-05-2003
If you look at the forum system at http://synthigence.com/forum which you
could modify...

It has a "Styler" control which you put on every page. If you make it
invisible, it looks in a table and sets a stylesheet value. If it is
visible, it displays a dropdown of available stylesheets and remembers which
the user selected (in a cookie).

charles

"Janaka" <> wrote in message
news:...
> There's no stylesheet control i'm aware of otherwise that would be the

best
> option.
> I'd say you can either do one of two options
> 1. Create a Literal control and set the text to equal "<link
> rel=\"stylesheet\" src=\"" + stylesource + \"">" at runtime
> 2. Set a variable in your Page_Load event and then bind or write this to
> your link tag. <link rel="stylesheet" src="<%= stylesource%>">
>
> "Marc Nederhoff" <> wrote in message
> news:boaj4o$68l$...
> > Hi all,
> >
> > Is it possible to add the <link rel="stylesheet"....> dynamicaly. All

> pages
> > in my site use the same style sheet, and I don't want to add the link
> > manualy because of maintenance.
> >
> > Marc
> >
> >

>
>



 
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
Dynamicaly adding buttons to Asp 2 Totto ASP .Net 6 08-22-2006 03:07 PM
Content Page specific style style sheet rshillington@gmail.com ASP .Net 0 07-14-2006 03:45 PM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
Problem with dynamicaly adding a hidden form element. IE vs NN Paul Javascript 2 11-17-2003 04:12 PM
how to make a group of dynamicaly radio buttons Bisser Milanov ASP .Net 2 06-26-2003 08:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57