ButtonLink in Datagrid passes ID to method
Posted on 2006-11-14
I use VB.NET
I have a datagrid which has been filled. I want to have a column which contains a LinkButton. When pressed that Link Button causes a Panel to appear that allows me to add records.
I know how to cause a Link Button to make the panel appear, disapear, etc.
But I want that Link Button to pass an ID from that datagrid record to that Panel (to a method for use in a database)
I know I can create a Hyperlink button to pass the ID in a URL, but I can't get that to work in this case.
I need an example of one of the following:
1) (Preferred) Link Button in DataGrid passes an ID to a method. Let's say the method just does a response.write of the ID.
2) Hyperlink passes BOTH the ID of a record in addition to an ID already in the URL.
Seems simple but I'm at a loss for the right solution.
Bonus points if both are answered and explained.