Solved

Adding dynamic button

Posted on 2014-02-19
6
273 Views
Last Modified: 2014-03-07
Hi,

I currently loop through a dataset and set out a table as follows:

 For Each dv2 As DataRowView In DvTheData2
                test1.Text += "<tr><td>" & dv2.Row.Item("Thematch") & "</td>" & colourcodeit(dv2.Row.Item("HAG"), "") & colourcodeit(dv2.Row.Item("AAG"), "") & colourcodeit(dv2.Row.Item("VAG"), "") & "</tr>"
            Next

Open in new window


I would like to add a button to the table with the value on Thematch -> this way i can add the match to my database to save later

The code would look something like this

 For Each dv2 As DataRowView In DvTheData2
                test1.Text += "<tr><td>" & dv2.Row.Item("Thematch") & "</td>" & colourcodeit(dv2.Row.Item("HAG"), "") & colourcodeit(dv2.Row.Item("AAG"), "") & colourcodeit(dv2.Row.Item("VAG"), "") & "<td>THEBUTTONGOESHERE</td></tr>"
            Next

Open in new window



How can i do this?
0
Comment
Question by:runnerjp2005
  • 3
  • 3
6 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39870474
Do you want it to be a html input control and then handle it using Javascript?
0
 

Author Comment

by:runnerjp2005
ID: 39870604
Thats not something i have looked into... how would that work?
0
 

Author Comment

by:runnerjp2005
ID: 39870606
basicly its just button click....add row to database
them if button is clicked again remove from database
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39870695
Where is this html rendered to?
0
 

Author Comment

by:runnerjp2005
ID: 39870743
i label on the from page
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39874172
You can create a javascript function which can call your code behind to do the database option. Then produce the html button control so that it calls the javascript function and passes the row information to it.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
edit .asp files 5 31
C#.net split string and then check appropriate checkboxlist 4 27
DataGridView / get bound table name? 8 28
Google Maps with Webforms 1 14
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question