Solved

Adding dynamic button

Posted on 2014-02-19
6
259 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now