I have a Listview that pulls and displays some data. Field 1 is the PK, Field 2 is a type identifier, and the rest are plain data. I have a button I’ve made that appears as the last field on every record. The button needs to be able to call the proper page based on Field 2, and pass it the value of Field 1.
How can I tell which record is being clicked, and grab the appropriate values for my logic?
|Field 1|Field 2|Button |
| 1| 2| Click |
| 2| 2| Click |
| 3| 1| Click |
In the markup of your
ListViewwhere you define your button, do this:Now, define a JS function like so:
You get the idea… you don’t need code behind for this unless you want to do something more than simply redirecting to a different page.