Gridview, links and passing a value

CaJack's Avatar
Go4Expert Member
Iím having trouble finding a way to pass a value from a gridview link item to the next page. If a user searches for a CD say queen and clicks submit all the CDs with the name queen are shown with there unique numbers and dates added. If the user clicks on one of the CD IDís it takes them to a page called cdview, the cd id will be used to retrieve all the information about the cd. Hereís an exampleÖ

Search CD = Queen (clicked submit)

(Gridview)
CD ID__________CD Name________Date
12______________Queen_________12/4/04
56______________Queen__________14/5/03
4________________Queen__________5/8/07

Iíve chosen the CD ID field to appear as a hyperlinkfield in the grid view options. Iíve also linked it to a page called CDView.aspx. On that page I hope to show the details of the CD that are stored in the sql database and allow the user to update the information.

My question is how do I pass the CD ID to the CDView page so I can then load up all the details about the CD? If the user clicks the CD ID link say the number 12 how do I pass that number 12 as an int to the CDViewPage?

Any help would be great.
Thanks,
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Create the hyperlink that points to CDView.aspx?CdId=<the cd id>

E.g.
CDView.aspx?CdId=12
0
CaJack's Avatar
Go4Expert Member
Thanks, for the help. from what you've said I've managed to get it working. Cheers, CaJack