Sunday, February 1, 2009

Link button in First Column of Gridview in C#

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
Int32 pdetcod;
pdetcod = Convert.ToInt32(GridView1.SelectedDataKey.Value);
Session["prjcode2"] = pdetcod;
Response.Redirect("frmempprjdet.aspx");
}
//comment
Right click on Gridview Properties and give DataKeyName="id"

No comments:

Post a Comment