


using System.Data (C#) / Imports System.Data (VB.NET)

Update : From the comment by wonjartran below let me point out that for using DataRowView, you will need to import System.Data namespace. Update: Finally I think the code-formatting now looks better.

Let me know if you find any and I will update this post accordingly. There might be some errors or some other ways. Hope one of these methods will come handy. So in our e.g.CustomerDetails.aspx?customerId=Ī) As I said earlier this concept will work for other databound controls but will need to make sure you use right event and right properties. Here it is CustomerID which we want to pass it to querystring.ī) DataNavigateUrlFormatString:This is the format of your url that will be rendered with the link. " selectcommand ="SELECT, , FROM " > Ī) DataNavigateUrlFields: This corresponds to the field whose value we want to pass it into the querystring. The code below uses HyperLinkField that will display Details link. For that we need at least a CustomerId, which we can pass it via querystring to customer details page. There is a link, Details, clicking on which will take you to another page CustomeDetails.aspx which will display more details about that customer. The SDS fetches CustomerID, CompanyName and ContactName from Northwind database. I will look into it and post back.īelow is the code with GridView bound to a SqlDataSource (SDS). If you find any difficulty post your question on forums and a link to that question as a comment to this post. All different ways shown below might not work will all but atleast on of them should work. There might need little modifications though based on which control you are using. Note: I will be taking example of GridView these concepts should work for other databound Controls like Repeater, DataList, Listview, etc. I would say all these are already documented but I am just putting it together. You can use any of these depending on your scenario. You have a page that displays Customer records in a GridView and you have a link, when clicked takes the user to another page, where you want to display detailed information of the customer record the user selected in the GridView. In most of the cases, you might want to pass a value to another page to know which row or item was clicked by the use. Say you have a databound control like Gridview, Repeater or ListView that contains a column with link (HyperLink) to another page.
