Change "Enabled" appearance for a LinkButton

Discussion in 'ASP .Net Web Controls' started by Nils M. Lunde, Oct 30, 2003.

  1. Hi!

    I'm trying to make a LinkButton appear black and not dimmed when disabled.
    To accomplish this I tried to override the Enabled property, but wthout
    any luck.
    No matter what I do in my derived property, the control remains dimmed.

    How can I make the disabled LinkButton appear black, or
    alternatively turn the LinkButton into a non-clickable black text field?

    Thanks in advance!

    ----
    Nils Magne Lunde
    Options AS
     
    Nils M. Lunde, Oct 30, 2003
    #1
    1. Advertising

  2. Nils M. Lunde

    HD Guest

    i think the code that is generated if the link button is disabled is just
    <span style="">your text</span> whereas if active its is <a href="">your
    text</a>
    y not use inherit from linkbutton and in render method use whatever output
    you fancy instead of say <span></span> with greyed out text

    HD

    "Nils M. Lunde" <> wrote in message
    news:eek:...
    > Hi!
    >
    > I'm trying to make a LinkButton appear black and not dimmed when disabled.
    > To accomplish this I tried to override the Enabled property, but wthout
    > any luck.
    > No matter what I do in my derived property, the control remains dimmed.
    >
    > How can I make the disabled LinkButton appear black, or
    > alternatively turn the LinkButton into a non-clickable black text field?
    >
    > Thanks in advance!
    >
    > ----
    > Nils Magne Lunde
    > Options AS
     
    HD, Oct 30, 2003
    #2
    1. Advertising

  3. That worked like a charm!

    ....but I still don't understand why the text is greyed out when I inherit
    the Enabled property.
    If I don't set MyBase.Enabled to false, how can the program know that it
    should print the text greyed out?

    Well, now it works anyway :)
    Thanx!

    -Nils Magne

    > i think the code that is generated if the link button is disabled is just
    > <span style="">your text</span> whereas if active its is <a href="">your
    > text</a>
    > y not use inherit from linkbutton and in render method use whatever
    > output
    > you fancy instead of say <span></span> with greyed out text
    >
    > HD
    >
    > "Nils M. Lunde" <> wrote in message
    > news:eek:...
    >> Hi!
    >>
    >> I'm trying to make a LinkButton appear black and not dimmed when
    >> disabled.
    >> To accomplish this I tried to override the Enabled property, but wthout
    >> any luck.
    >> No matter what I do in my derived property, the control remains dimmed.
    >>
    >> How can I make the disabled LinkButton appear black, or
    >> alternatively turn the LinkButton into a non-clickable black text field?
    >>
    >> Thanks in advance!
    >>
    >> ----
    >> Nils Magne Lunde
    >> Options AS

    >
    >




    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
     
    Nils M. Lunde, Oct 31, 2003
    #3
  4. Nils M. Lunde

    James Radke Guest

    Nils,

    I am looking at doing the same thing.. do you have a sample of your new
    Class you created inherited from the LinkButton? Would you be willing to
    share this?

    Thanks

    Jim

    "Nils M. Lunde" <> wrote in message
    news:eek:...
    >
    > That worked like a charm!
    >
    > ...but I still don't understand why the text is greyed out when I inherit
    > the Enabled property.
    > If I don't set MyBase.Enabled to false, how can the program know that it
    > should print the text greyed out?
    >
    > Well, now it works anyway :)
    > Thanx!
    >
    > -Nils Magne
    >
    > > i think the code that is generated if the link button is disabled is

    just
    > > <span style="">your text</span> whereas if active its is <a href="">your
    > > text</a>
    > > y not use inherit from linkbutton and in render method use whatever
    > > output
    > > you fancy instead of say <span></span> with greyed out text
    > >
    > > HD
    > >
    > > "Nils M. Lunde" <> wrote in message
    > > news:eek:...
    > >> Hi!
    > >>
    > >> I'm trying to make a LinkButton appear black and not dimmed when
    > >> disabled.
    > >> To accomplish this I tried to override the Enabled property, but wthout
    > >> any luck.
    > >> No matter what I do in my derived property, the control remains dimmed.
    > >>
    > >> How can I make the disabled LinkButton appear black, or
    > >> alternatively turn the LinkButton into a non-clickable black text

    field?
    > >>
    > >> Thanks in advance!
    > >>
    > >> ----
    > >> Nils Magne Lunde
    > >> Options AS

    > >
    > >

    >
    >
    >
    > --
    > Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
     
    James Radke, Oct 31, 2003
    #4
    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. Gabor
    Replies:
    3
    Views:
    632
    Jacob Yang [MSFT]
    Aug 26, 2003
  2. Steve Richter
    Replies:
    1
    Views:
    559
    Brock Allen
    May 20, 2005
  3. Sathyaish
    Replies:
    3
    Views:
    3,120
    Sathyaish
    Sep 8, 2005
  4. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    194
    Sathyaish
    Sep 8, 2005
  5. Rajesh S

    Enabled property of Asp Linkbutton not working in Netscape

    Rajesh S, Feb 7, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    111
    Rajesh S
    Feb 7, 2005
Loading...

Share This Page