473,396 Members | 2,014 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,396 software developers and data experts.

CSS - Styles

e.Item.CssClass = "SelectedTab";Hello all,

I am using .NET 1.1, VS 2003 - Syntax is C#

I am trying to change ('enhanced') attributes set by an css-file dynamically.

Content of an CSS-File:
..WhatEver
{
...
background-image: url(SecretApp/skins/default/images/inactive.gif);
...
}

To apply this style I do the following:
<instance of System.Web.UI.WebControls>.CssClass = "WhatEver";
hyperlink.CssClass = "WhatEver";

That works. But now it comes. I want to Change the Value of this
Style - let's say the Folder.

hyperlink.Style["background-image"] = "new folder"; does not work
of course.

How does that work? Is there an enhanced and secret Style Collection?

Thank you in advance 4 your help.

Nov 18 '05 #1
2 1542
Hi Schabus,

The way of changing the Styles dynamically is just the same

Webcontro.Style[key] = value;

i think that the problem is that you have to use

hyperlink.Style["background-image"] = "url(new folder/file name)";

Hope this helps
Martin

"Guenther Schabus" <Gu*************@discussions.microsoft.com> wrote in
message news:8E**********************************@microsof t.com...
e.Item.CssClass = "SelectedTab";Hello all,

I am using .NET 1.1, VS 2003 - Syntax is C#

I am trying to change ('enhanced') attributes set by an css-file dynamically.
Content of an CSS-File:
.WhatEver
{
...
background-image: url(SecretApp/skins/default/images/inactive.gif);
...
}

To apply this style I do the following:
<instance of System.Web.UI.WebControls>.CssClass = "WhatEver";
hyperlink.CssClass = "WhatEver";

That works. But now it comes. I want to Change the Value of this
Style - let's say the Folder.

hyperlink.Style["background-image"] = "new folder"; does not work
of course.

How does that work? Is there an enhanced and secret Style Collection?

Thank you in advance 4 your help.

Nov 18 '05 #2
Hi,

..myClass
{
color:green
}

<element class="myClass" style="color:red">

More
http://msdn.microsoft.com/library/de...stylesheet.asp
--
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/
http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground: http://213.190.104.211/ ( IE 5.5+ only )

No matter where you go there you are
==============================
"Guenther Schabus" <Gu*************@discussions.microsoft.com> wrote in
message news:8E**********************************@microsof t.com...
e.Item.CssClass = "SelectedTab";Hello all,

I am using .NET 1.1, VS 2003 - Syntax is C#

I am trying to change ('enhanced') attributes set by an css-file
dynamically.

Content of an CSS-File:
.WhatEver
{
...
background-image: url(SecretApp/skins/default/images/inactive.gif);
...
}

To apply this style I do the following:
<instance of System.Web.UI.WebControls>.CssClass = "WhatEver";
hyperlink.CssClass = "WhatEver";

That works. But now it comes. I want to Change the Value of this
Style - let's say the Folder.

hyperlink.Style["background-image"] = "new folder"; does not work
of course.

How does that work? Is there an enhanced and secret Style Collection?

Thank you in advance 4 your help.

Nov 18 '05 #3

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

Similar topics

0
by: Quinton | last post by:
I'm running a website that uses CSS to format the text and a CGI program Coranto that icludes news updates via SSI. My problem is that some parts of the CSS don't seem to take effect on the...
6
by: Tristan Miller | last post by:
Greetings. Can someone point me to a good source of nice, simple stylesheets, similar to the W3C Core Styles provided at http://www.w3.org/StyleSheets/Core/? I don't need anything fancy like...
12
by: dan.vendel | last post by:
Hi, I know nothing about javascript, but quite a lot about regulat html and CSS. Have bumped into a problem that people in this fine congregation perhaps can help me with. I'm making a...
3
by: JezB | last post by:
What's the generally accepted approach for using Styles and Stylesheets in a web application based on .aspx files, Web Controls, User Controls, and code-behind modules (c# in my case)? Most style...
7
by: sasquatch | last post by:
Hi, I've a a site with nested master pages and content pages. I tried using a theme with a stylesheet in the app_themes directory referencing it in the web.config file from a pages tag theme...
3
by: spolsky | last post by:
hi, it is possible to apply multiple styles as shown in the following example. <STYLE TYPE="text/css"><!-- BODY { background-color:salmon; } P { margin-left:20px; } .clsCode {...
0
by: matt urbanowski | last post by:
Hi, I have a calendar control on a form in VS2003 and have applied some styles to it. I have separate styles for all of the groups e.g. DayHeaderStyle, DayStyle, NextPrevStyle etc. and one for the...
4
by: splounx | last post by:
Hi there, I am a relative CSS & JavaScript novice and I have a particular problem that is beyond my level of knowledge so I thought I'd tap the collective wisdom of this group. I would like...
2
by: newbie | last post by:
Is there a tool to identify used / unused styles in a stylesheet? I have a tendency to accumulate styles in a stylesheet. Many of these styles are not actually employed by the page, so many of...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
On my old workstation (development workstation) if I set Application/Enable XP visual styles - I was able to get/see the visual styles - like button borders highlighting when you run the mouse over...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.