473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Insert <link rel="stylesheet"....>

Hello everybody

Ihave few .CSS files, I let user select the color schema of the whole site
using a radiobutton and save it in a cookie..
I want to retrieve the value of the cookie <link href=" HERE "
rel="stylesheet">
i try to put it using InnerHtml or InnerText but it fail using div, span so
on...
how can i handle this..
thanx
Nov 18 '05 #1
3 2644
Just use good old variables. In code behing add a public variable and then
insert server side script inside href like this:
<link href=" <%=strCSSName%>" rel="stylesheet">
"Islam Elkhayat" wrote:
Hello everybody

Ihave few .CSS files, I let user select the color schema of the whole site
using a radiobutton and save it in a cookie..
I want to retrieve the value of the cookie <link href=" HERE "
rel="stylesheet">
i try to put it using InnerHtml or InnerText but it fail using div, span so
on...
how can i handle this..
thanx

Nov 18 '05 #2
I think it's safe to say that that's a bad suggestion. This isn't ASP.

Instead, try doing:
<link rel="stylesheet" type="text/css" id="link" runat="server" />

and in codebehind:

protected HtmlGenericControl link;
private void Page_Load(object sender, EventArgs e) {
link.Attributes.Add("href", "somestyle.css");
}

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"WebMatrix" <We*******@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
Just use good old variables. In code behing add a public variable and then
insert server side script inside href like this:
<link href=" <%=strCSSName%>" rel="stylesheet">
"Islam Elkhayat" wrote:
Hello everybody

Ihave few .CSS files, I let user select the color schema of the whole site using a radiobutton and save it in a cookie..
I want to retrieve the value of the cookie <link href=" HERE "
rel="stylesheet">
i try to put it using InnerHtml or InnerText but it fail using div, span so on...
how can i handle this..
thanx

Nov 18 '05 #3
I didnt know you could do that. Learn something new everyday.

"Karl Seguin" wrote:
I think it's safe to say that that's a bad suggestion. This isn't ASP.

Instead, try doing:
<link rel="stylesheet" type="text/css" id="link" runat="server" />

and in codebehind:

protected HtmlGenericControl link;
private void Page_Load(object sender, EventArgs e) {
link.Attributes.Add("href", "somestyle.css");
}

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"WebMatrix" <We*******@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
Just use good old variables. In code behing add a public variable and then
insert server side script inside href like this:
<link href=" <%=strCSSName%>" rel="stylesheet">
"Islam Elkhayat" wrote:
Hello everybody

Ihave few .CSS files, I let user select the color schema of the whole site using a radiobutton and save it in a cookie..
I want to retrieve the value of the cookie <link href=" HERE "
rel="stylesheet">
i try to put it using InnerHtml or InnerText but it fail using div, span so on...
how can i handle this..
thanx


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Stan Brown | last post by:
The page http://w3development.de/css/hide_css_from_browsers/media/ suggests using @media all { } around rules to hide them from older browsers. Suppose the above occurs in a style sheet that...
3
by: Islam Elkhayat | last post by:
Hello everybody Ihave few .CSS files, I let user select the color schema of the whole site using a radiobutton and save it in a cookie.. I want to retrieve the value of the cookie <link href=" ...
2
by: yer darn tootin | last post by:
Here's the scenario: I have a javascript function taking the contents of a datalist ( content from a SQL db ) and opening it in a new window to allow the user to print. The pop-up window...
0
by: Emil Christopher Melar | last post by:
I wanted to use App_Theme, because then I might have some automation when it comes to not hard coding paths for the css. And as you know, you know that mozilla and IE renders differently, and...
1
by: melda | last post by:
I am a real beginnner in ASP. Due to increasing demands on dynamic website, I've been working on ASP website now. I use a ready to use CMS program and right now I've been trying to combine a calendar...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
3
by: PJ6 | last post by:
Embedded javascript can be served from a DLL with an include that uses a special URL generated by the Page.ClientScript.GetWebResourceUrl method at runtime. For example: <script...
7
by: Anette | last post by:
Hi, I'm very new at PHP. I've tried for a long time now to get a page that has a form in a certain way: 1. When form is submitted the data in a table should be writted on the same page. 2....
3
by: joe | last post by:
Is it OK to have multiple: <script type="text/javascript" src="funcs1.js"></script> <script type="text/javascript" src="funcs2.js"></script> <script type="text/javascript"...
23
by: Stanimir Stamenkov | last post by:
I want to find out whether the following usage of the "Bookmark" link type is o.k. An example could be seen at <http://www.geocities.com/stanio/more/horoskop.html>. The text is in Bulgarian and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.