I have a GridView control on my page that I have defined a number of BoundFields for. Each row of the databound GridView has a CommandField (Select), for which I want to send the PostBack to a new page.
Of course I could easily send the NewSelectedIndex in a QueryString, but I’d rather keep that information hidden from the user. Suggestions?
Leppie is right. The GridView has no PostbackUrl property. However, you can do what you want by using a standard control, which has a PostbackUrl property.
In this sample code, I added a TemplateColumn to the GridView. I use a dynamically added Tag attribute for the button to pass the Id, then I use Javascript code to put the value in a hidden field, and then the button simply postsback to the page specified in the PostbackUrl property.