473,386 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1283
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: José Teixeira Junior | last post by:
I need add one new unknown control at runtime and the only one information that i have is one string with type of control. Example: c = "System.Windows.Forms.TextBox" How i can create one...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
2
by: Doug Slocum | last post by:
Hi, I'm using ASP.NET. I need help adding new buttons to my web page at run time on the server side prior to sending to the client. As the web form is loading, I won't know in advance how many...
1
by: Brian Conklin | last post by:
Hello Eneryone, I am having a problem. I have written a little app that will take a text "pipe" delimited file and place all of the values in to an Excel spreadsheet. It works great on any of my...
1
by: John Hughes | last post by:
Im adding a button at runtime to a datagrid but the DataGrid1.ItemCommand event does not fire. I also have a button that I added at design time and this button does fire the event ItemCommand. ...
0
by: Kurt | last post by:
Hi Brent, I don't know if this is best practices per se`, but it works. The following generates a new button control each time menu item 1 is clicked and assigns an event handler to it. ...
6
by: Totto | last post by:
Hi, Anyone know the best solution to dynamically add buttons to a asp 2.0 page using data from Sql server? Are there any contols suitable for this or is it best to iterate the dataset and...
1
by: somaskarthic | last post by:
Hi In my application , i need to create table rows at runtime. Using javascript with table id arguments i could replicate the rows at runtime. Each of these rows has checkboxes (7.no) , dropdown...
11
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.