Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Reacting to events of a composite controls

Reply
Thread Tools

Reacting to events of a composite controls

 
 
ree32
Guest
Posts: n/a
 
      09-09-2004
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
 
Reply With Quote
 
 
 
 
Jos
Guest
Posts: n/a
 
      09-13-2004
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/quickst...x#postbackevts

--

Jos


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listening to events without (over)reacting K Viltersten Javascript 0 06-16-2008 04:58 AM
Windows Explorer Addres Bar Too Quick Reacting Martin Harran Computer Support 2 06-06-2007 08:03 PM
Reacting on events from IO.Port on WebSite Maciej Sondej ASP .Net 5 05-02-2007 03:50 PM
Composite control with dynamic composite controls sleigh ASP .Net 1 02-12-2004 06:24 PM
Child controls in Composite Controls not firing events David Boike ASP .Net Web Controls 0 08-07-2003 05:39 PM



Advertisments