protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
DataContext db = new DataContext();
using (var SI = new DataContext())
{
var search = (from l in SI.****
orderby l.*** descending
where l.**** == l.****
select l).First();
Session["ID"] = search.***;
Response.Redirect("http://localhost:63558/****.aspx");
}
}
So here I have it so when I hit "Edit" on the gridview it takes me to a new page. I want to be able to grab an ID from that row and save as session.
Say the person has an ID of 3 I click edit on him and then it shows 3 as the ID. But right now it only shows since it's in descending shows last person even if I click on the first person.
If any of this makes any sense. Want to look at that column and that row after I hit edit and save that ID as session.
Any help would be awesome thanks.