Reputation: 1437
How to redirect to another page and take the information from the previous page ? I need this for one task. The task is:
By using a GridView display the names of all employees from Northwind database as hyperlinks. All links should redirect to another page where details about the employee are displayed in a DetailsView. Add a back button to return back to the previous page.
I am stucked here:
All links should redirect to another page where details about the employee are displayed in a DetailsView.
Upvotes: 0
Views: 121
Reputation: 50728
You can use the hyperlinkfield for the GridView, which can define querystring parameters and bind them from the database. Check out this tutorial.
An example taken from the site:
<asp:HyperLinkField
DataTextField="UnitPrice"
DataTextFormatString="GBP {0}"
DataNavigateUrlFields="ProductID" HeaderText="Unit Price"
DataNavigateUrlFormatString="ProductDetails.aspx?ProductID={0}" />
Upvotes: 2