CSS - Styles

G

Guest

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.
 
M

Martin Marinov

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
 
V

Vidar Petursson

Hi,

..myClass
{
color:green
}

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

More
http://msdn.microsoft.com/library/d...or/dhtml/reference/objects/obj_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
==============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top