Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/forums/asp/)
-   -   Gridview, links and passing a value (http://www.go4expert.com/forums/gridview-links-passing-value-t4123/)

CaJack 4May2007 01:28

Gridview, links and passing a value
 
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,

pradeep 4May2007 09:37

Re: Gridview, links and passing a value
 
Create the hyperlink that points to CDView.aspx?CdId=<the cd id>

E.g.
CDView.aspx?CdId=12

CaJack 4May2007 17:49

Re: Gridview, links and passing a value
 
Thanks, for the help. from what you've said I've managed to get it working. Cheers, CaJack


All times are GMT +5.5. The time now is 08:38.