Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Dynamic Control capture button click.

Reply
Thread Tools

Dynamic Control capture button click.

 
 
sakieboy
Guest
Posts: n/a
 
      02-28-2005
I have dynamically added controls using a Placeholder to a form. This form
is data driven thus I never know how many records will be retrieve. My form
looks like this
txtKey0=1111, txtBox0, txtDate0, btnEdit0
txtKey1=2323, txtBox1, txtDate1, btnEdit1
txtKey2=4343, txtBox2, txtDate2, btnEdit2
etc.

When I select a button I need to find out what my txtkey value is so that I
can pass it to a Querystring and display another page. Of course, currently
I only have one btnEdit_Click event which seems pretty lost. How do I get my
key values depending upon the button that I select. Or would I be better off
putting this in a datagrid control?
 
Reply With Quote
 
 
 
 
Wilco Bauwer
Guest
Posts: n/a
 
      02-28-2005
A datagrid, repeater or datalist may be a good choice. If you do not
use that, then you can set the button's CommandName and CommandArgument
properties. Instead of handling their click event, you should then
handle the Command event. All controls' Command event can have the same
event handler. Inside that event handler you can then extract the
information from the CommandName/CommandArgument properties to do your
thing.

In case you have problems related to dynamically loaded controls, you
may also want to take a look at
http://wilcoding.xs4all.nl/Wilco/View.aspx?NewsID=147.

----
- Wilco Bauwer
Blog & Custom Controls @ http://wilcoding.xs4all.nl

 
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
Screen Capture With Mouse , Mouse Position Capture Max Java 7 08-08-2009 11:51 PM
SuperVideoCap work as a broadcast capture and screen capture and record tool. hely0123 Media 0 10-30-2007 08:59 AM
placement of dynamic control depends on VALUE of dynamic control Larry Bud ASP .Net 1 01-10-2007 10:07 PM
Dynamic Table with Dynamic Button inside Kooki ASP .Net Web Controls 0 09-15-2005 07:12 PM
Responding to Button control events when Button is added to a Table Control Jim Gilligan ASP .Net Web Controls 0 09-01-2005 06:29 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57