CSS - Styles

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guenther Schabus

    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.



  • Martin Marinov

    #2
    Re: CSS - Styles

    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" <GuentherSchabu s@discussions.m icrosoft.com> wrote in
    message news:8EC0B97E-B7EC-4A83-BBF5-BC85183D5999@mi crosoft.com...[color=blue]
    > 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[/color]
    dynamically.[color=blue]
    >
    > 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.
    >
    >
    >[/color]


    Comment

    • Vidar Petursson

      #3
      Re: CSS - Styles

      Hi,

      ..myClass
      {
      color:green
      }

      <element class="myClass" style="color:re d">

      More



      --
      Best Regards
      Vidar Petursson
      =============== ===============
      Microsoft Visual: Scripting MVP 2000-2004
      Stress free and easy shopping experience. Simple and speedy service.

      http://www.deus-x.com/ Instant e-commerce
      Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

      Playground: http://213.190.104.211/ ( IE 5.5+ only )

      No matter where you go there you are
      =============== ===============
      "Guenther Schabus" <GuentherSchabu s@discussions.m icrosoft.com> wrote in
      message news:8EC0B97E-B7EC-4A83-BBF5-BC85183D5999@mi crosoft.com...[color=blue]
      > 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.
      >
      >
      >[/color]


      Comment

      Working...