GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
protected void lkb1_Click(object sender, EventArgs e) { LinkButton lnkbtn = sender as LinkButton; GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow; string filePath = GridView1.DataKeys[gvrow.RowIndex].Value.ToString(); Response.ContentType = "image/jpg"; Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\""); Response.TransmitFile(Server.MapPath(filePath)); Response.End(); }
GridView1.DataKeys[gvrow.RowIndex].Value.ToString();
RowIndex
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)