468,771 Members | 1,847 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,771 developers. It's quick & easy.

adding button on runtime with values

Hi
I have this table which I create on runtime with some rows from my
database.
What I want to do is when I create the table I want to create a button/
linkbutton/link or something beside each entry from the database and
when the user clicks on this button i want to remove the database
entry from the table.

So I guess my question is, how do I create a button with an onClick
event on runtime that knows what row it belong to.. So i can put in my
code that when this specific button gets clicked that I want to delete
this specific row which this button belongs to?
I am using asp.net and C#.

If you understand any of this mumbling, please help..

Sep 19 '07 #1
1 1179
Why don't you use a GridView control? It will build the table for you and
you can have a CommandField with a delete button in it.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"kollasaeta" <ko*********@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
Hi
I have this table which I create on runtime with some rows from my
database.
What I want to do is when I create the table I want to create a button/
linkbutton/link or something beside each entry from the database and
when the user clicks on this button i want to remove the database
entry from the table.

So I guess my question is, how do I create a button with an onClick
event on runtime that knows what row it belong to.. So i can put in my
code that when this specific button gets clicked that I want to delete
this specific row which this button belongs to?
I am using asp.net and C#.

If you understand any of this mumbling, please help..

Sep 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Josť Teixeira Junior | last post: by
3 posts views Thread by Jim Heavey | last post: by
2 posts views Thread by Doug Slocum | last post: by
1 post views Thread by Brian Conklin | last post: by
1 post views Thread by John Hughes | last post: by
reply views Thread by Kurt | last post: by
6 posts views Thread by Totto | last post: by
1 post views Thread by somaskarthic | last post: by
11 posts views Thread by Pete Kane | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.