Edit Templates
Hi, to all. I have taken a template column in a datagrid and have inserted image button as an item template. I want when the user click that button it identifies the project code which is bound column where data is coming from backend SQL server. When he click on that image button it should identify the project code of that column and then pass that particular value to session variable and then redirect to the next page. Earlier i used select button of the datagrid and used selectedIndexchanged as an event in which i was identifying columns and passing that value to session variables and after passing those values i
was redirecting to the next page.
Private Sub dg_summary_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dg_summary.SelectedIndexChanged
Session("PName") = dg_summary.SelectedItem.Cells(0).Text
Session("PCode") = dg_summary.SelectedItem.Cells(1).Text
Response.Redirect("report.aspx")
End Sub
But this logic won't work in case of item templates. Can you tell the possible solution. The only thing i could think of is using
itemcommand as event and then pass the value in e.command argument.
|