473,789 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS - Styles

e.Item.CssClass = "SelectedTab";H ello 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.W ebControls>.Css Class = "WhatEver";
hyperlink.CssCl ass = "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 1560
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.m icrosoft.com> wrote in
message news:8E******** *************** ***********@mic rosoft.com...
e.Item.CssClass = "SelectedTab";H ello 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.W ebControls>.Css Class = "WhatEver";
hyperlink.CssCl ass = "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:re d">

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.m icrosoft.com> wrote in
message news:8E******** *************** ***********@mic rosoft.com...
e.Item.CssClass = "SelectedTab";H ello 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.W ebControls>.Css Class = "WhatEver";
hyperlink.CssCl ass = "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
1989
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 included news. All four link styles are used, and all four work in the included text files. The text styles, on the other hand, seem not to work at all. The text that's part of the actual HTML file is formated according to the CSS codes. However, the...
6
2828
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 multiple columns; I just want some more elegant combinations of fonts and colours for all the basic HTML elements. The Open Directory Project has a whole category devoted to CSS layouts, but as far as I can tell most of those sites concentrate on...
12
2577
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 webshop. When user eventually ends up at the credit card processor's secure pages, the styles are quite different from the actual site's. I have managed to change some basics through a control
3
1480
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 and stylesheet guides on the internet seem to be based on web sites (rather than applications) based on relatively static textual information. I have read that external stylesheet files are the way to go, but it seems to me that these only lend...
7
3509
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 attribute. This works for the content pages, but it doesn't seem able to apply the styles to the top master page even though I did set the master head tag to runat server. Is this by design? If so, what is the best way to apply styles to the top...
3
2046
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 { font-family:"Comic Sans MS"; font-size:10pt; color:navy;}
0
971
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 whole calendar. When I preview the calendar in Visual Studio, it looks fine. However, when I view the calendar in Internet Explorer, some of the styles don't appear how they should - for example, the next/previous month buttons come out black...
4
2713
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 to know if there is a means of writing JavaScript that will dynamically display the styles which are currently applied to any DOM element on a web page ( i.e., those applied by ID, those applied by class, etc.) as the user moves their mouse over...
2
1833
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 the defined styles are redundant. Is there a way to identify which styles are used or not used? My normal way is to make changes to one section, then look at the page to see if anything changes, if it does, the style is in use and I have
1
1977
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 them. But on my new workstation (development workstation) I can't get the visual styles to work. Matter of fact, the button controls appear raised (like in old VB6). I downloaded/Installed a bunch of updates for VS2005 after I got the new...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.