By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,510 Members | 1,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,510 IT Pros & Developers. It's quick & easy.

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

P: n/a
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 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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 16 '05 #2

P: n/a
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 16 '05 #3

P: n/a
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 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.