Reacting to events of a composite controls

Discussion in 'ASP .Net Building Controls' started by ree32, Sep 9, 2004.

  1. ree32

    ree32 Guest

    I have read some tutorials on composite controls. They all all tend to
    be on static controls such as tables etc. They don't seem to cover on
    dealing with user events on the controls.

    I have created some LinkButtons on a composite control, but I need to
    be able to react to which of these linkbuttons the user presses.
    So I need set parameters of onCommand CommandArgs for the linkbuttons.
    BUt I cannot add these when creating the controls.


    I tried this

    lbtn.CommandName = "openSub"
    lbtn.CommandArgument = "subArgs"
    lbtn.Visible = True

    Controls.Add(lbtn)


    Only the visible works these rest dont show up on the HTML page.


    Is there a way to do this?

    Thanks
     
    ree32, Sep 9, 2004
    #1
    1. Advertising

  2. ree32

    Jos Guest

    ree32 wrote:
    > I have read some tutorials on composite controls. They all all tend to
    > be on static controls such as tables etc. They don't seem to cover on
    > dealing with user events on the controls.
    >
    > I have created some LinkButtons on a composite control, but I need to
    > be able to react to which of these linkbuttons the user presses.
    > So I need set parameters of onCommand CommandArgs for the linkbuttons.
    > BUt I cannot add these when creating the controls.
    >
    >
    > I tried this
    >
    > lbtn.CommandName = "openSub"
    > lbtn.CommandArgument = "subArgs"
    > lbtn.Visible = True
    >
    > Controls.Add(lbtn)
    >
    >
    > Only the visible works these rest dont show up on the HTML page.
    >
    >
    > Is there a way to do this?
    >
    > Thanks


    Take a look at the AddHandler function.

    Look here for a tutorial that covers user events in composite controls:
    http://www.dotnetjunkies.com/quickstart/aspplus/doc/webctrlauthoring.aspx#postbackevts

    --

    Jos
     
    Jos, Sep 13, 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. sleigh
    Replies:
    1
    Views:
    2,691
    sleigh
    Feb 12, 2004
  2. Maciej Sondej

    Reacting on events from IO.Port on WebSite

    Maciej Sondej, May 2, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    410
    bruce barker
    May 2, 2007
  3. David Boike

    Child controls in Composite Controls not firing events

    David Boike, Aug 7, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    316
    David Boike
    Aug 7, 2003
  4. Mike

    Composite vs non composite Controls

    Mike, Mar 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    265
    Sundararajan
    Mar 11, 2005
  5. K Viltersten

    Listening to events without (over)reacting

    K Viltersten, Jun 16, 2008, in forum: Javascript
    Replies:
    0
    Views:
    76
    K Viltersten
    Jun 16, 2008
Loading...

Share This Page