Set DataKeyNames value |
|
Posted By
Moderator1
on
2/14/2008 12:20:57 AM |
|
|
|
Description: |
Hi,
Set DataKeyNames property of the GridView to your Identity column name. Then you can use that value as follows in you code-behind.
int RowIndex=Convert.ToInt32(e.CommandArgument);
hypNextPage.NavigateUrl="NextPage.aspx?id="+GridView1.DataKeys[RowIndex].Value;
You have write this in the ItemDataBound or ItemCommand event. |
|
|
|