Reacting to events of a composite controls

R

ree32

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
 
J

Jos

ree32 said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,167
Latest member
SusanaSwan
Top