Changing a control to another type - can it be done??

Discussion in 'ASP .Net Web Controls' started by Bob H, Mar 4, 2004.

  1. Bob H

    Bob H Guest

    Hi,

    I've a LinkButton in a Repeater. I'd like to 'change' this to a label
    depending upon the value in the item (which I've got through the ItemCreated
    event). Can this been done at all (I'm working in vb)?

    something like
    ItemCreated event
    - get eventarg
    - if data from eventarg = 'A' then display in linkbutton
    else
    change linkbutton to label and display text

    At the moment, I've a clunky method of having a label and Linkbutton side by
    side and making the Linkbutton.visible = false depending upon the data.

    Many thanks for any advice

    Bob
     
    Bob H, Mar 4, 2004
    #1
    1. Advertising

  2. Bob H

    Felbrigg Guest

    A simple way to do this is to have two controls, one a link and one a lable,
    then make the one you dont want invisible.




    "Bob H" <> wrote in message
    news:c271ci$pct$...
    > Hi,
    >
    > I've a LinkButton in a Repeater. I'd like to 'change' this to a label
    > depending upon the value in the item (which I've got through the

    ItemCreated
    > event). Can this been done at all (I'm working in vb)?
    >
    > something like
    > ItemCreated event
    > - get eventarg
    > - if data from eventarg = 'A' then display in linkbutton
    > else
    > change linkbutton to label and display text
    >
    > At the moment, I've a clunky method of having a label and Linkbutton side

    by
    > side and making the Linkbutton.visible = false depending upon the data.
    >
    > Many thanks for any advice
    >
    > Bob
    >
    >
     
    Felbrigg, Mar 4, 2004
    #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. Samridhi Kumar Shukla
    Replies:
    1
    Views:
    532
    Alvin Bruney
    Nov 30, 2003
  2. nail
    Replies:
    0
    Views:
    1,564
  3. João Gomes
    Replies:
    4
    Views:
    301
    fnegroni
    Feb 8, 2008
  4. Paul D. Fox

    I guess this can't be done can it ?

    Paul D. Fox, Jul 1, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    140
    Steve Walker
    Jul 2, 2005
  5. Zhidian Du
    Replies:
    0
    Views:
    168
    Zhidian Du
    Feb 21, 2004
Loading...

Share This Page