We have done this in datagrids, suppose you need to click on a item in a gridview and provide detailed information about that item in a new page...one of the ways to do it is pass the value as a querystring to another page and retrieve it there. To accomplish this, all you have to do is,
1. Add a hyperlink field (in datagrids this was HyperlinkColumn).
2. Set the DataNavigateUrlFields to the parameter you want to pass in the querystring (In DataGrids this was DataNavigateUrlField.)
3. The DataTextField is the Field from the DataBase you are binding to the Grid. (it was the same in DataGrids)
paste the code below into ur gridview to make it work.
(Please include the starting <>asp:HyperLinkField HeaderText="AnyTextwillwork" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="OrderDetails.aspx?OrderID={0}" DataTextField="ID"/>
Then you know the rest, use Request.QueryString["OrderID"].ToString() to retrieve the value in the next page..do your processes there..
hope this helps and comes handy.
Happy Coding :)
Friday, February 16, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment