How to utilize the CommandArgument value alongside PostBackUrl functionality??
Posted on 2006-06-22
I have a gridview that displays a list of links. Each link has a commandArgument (pulled from the database), like so...
<asp:linkbutton runat="server" ID="lnk" Text="Click to View" PostBackUrl="~/page2.aspx" CommandArgument='<%# Eval("ID") %>' />
I'd like the link to post to a new page (page2.aspx), but yet still have access to the link's commandArgument value in the destination page.
Is this possible??
I've tried both queryString and Session to pass the value across to page2, but each seem to have their weaknesses.
I know I can use PreviousPage.FindControl in a normal non-gridview situation, but how does it work is this instance??