How to remove CssClass of a control?

Discussion in 'ASP .Net' started by Hardy Wang, Nov 13, 2003.

  1. Hardy Wang

    Hardy Wang Guest

    Hi:
    I have controls in my ASP.NET pages, for example, I have a LinkButton
    btnA. I programmatically set its style by btnA.CssClass = "MyStyle", then
    how can I remove its styles programmatically?
    I tried btnA.CssClass = null, I got exception "Specified argument was
    out of the range of valid values. Parameter name: value".

    Thanks for any suggestion.

    --
    WWW: http://hardywang.1accesshost.com
    ICQ: 3359839
    yours Hardy
     
    Hardy Wang, Nov 13, 2003
    #1
    1. Advertising

  2. Hardy Wang

    JL Guest

    btnA.CssClass = "" ;

    Maybe?


    "Hardy Wang" <> wrote in message
    news:%...
    > Hi:
    > I have controls in my ASP.NET pages, for example, I have a LinkButton
    > btnA. I programmatically set its style by btnA.CssClass = "MyStyle", then
    > how can I remove its styles programmatically?
    > I tried btnA.CssClass = null, I got exception "Specified argument was
    > out of the range of valid values. Parameter name: value".
    >
    > Thanks for any suggestion.
    >
    > --
    > WWW: http://hardywang.1accesshost.com
    > ICQ: 3359839
    > yours Hardy
    >
    >
     
    JL, Nov 13, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mervin Williams

    Setting CSSClass property of Label control?

    Mervin Williams, Apr 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,565
    Scott
    Apr 6, 2004
  2. =?Utf-8?B?bXN1aw==?=

    CssClass and HTML file field control

    =?Utf-8?B?bXN1aw==?=, Nov 25, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    679
    =?Utf-8?B?bXN1aw==?=
    Nov 30, 2004
  3. kurt sune

    A question of (web)control and CssClass

    kurt sune, Jan 17, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    408
    Paul Henderson
    Jan 17, 2006
  4. George Jordanov Ivanov

    Literal control doesn't have CssClass property?

    George Jordanov Ivanov, Mar 30, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    15,784
    WarNov
    Sep 13, 2006
  5. =?Utf-8?B?QVNQIERldmVsb3Blcg==?=

    CssClass property is ignored with wizard control (For some Users)

    =?Utf-8?B?QVNQIERldmVsb3Blcg==?=, Sep 19, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    641
    =?Utf-8?B?QVNQIERldmVsb3Blcg==?=
    Sep 19, 2006
Loading...

Share This Page