Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2003, 03:03 PM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamically adding style sheets ?

Hi,
I need to dynamically include a style sheet in my control, but not sure how to do this in the code?
I am getting they style sheet name from a database and then need to add it to the control.

Thanks!

 
Old August 21st, 2003, 06:40 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Despite how this looks, I think it works:
Code:
<link rel="stylesheet" type="text/css"
href="<asp:Literal runat="server" id="litStyleSheetURL" />">
Then you set the literal value in your code behind. (Don't forget to set up the literal field in the codebehind class.)

OR
Code:
<asp:Literal runat="server" id="litStyleSheetLink" />
and generate the whole <link> tag text in the codebehind.

------------------------
Peter
Somewhere outside Boston, MA USA





Similar Threads
Thread Thread Starter Forum Replies Last Post
SHORTCUT for linking style sheets? dearmisskat CSS Cascading Style Sheets 1 March 27th, 2007 06:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.