Doc Holiday 0 Newbie Poster

Hello All,

I need to pass two session varaibles from gridview to open another page ("Detail.aspx") I got the session varaibles work with the "AutoGenerateSelectButton = true". But I need to use an image instead and not sure where to start. I got the images to display and open the ("Detail.aspx") but no data. Any help is greatly appreciated. Please include codes sample.

Thanks
DocHoliday

My codes below

aspx page :

<asp:GridView ID="gvPatientsCharts" runat="server" AutoGenerateColumns="False" DataKeyNames="person,practice"
Style="z-index: 102; left: 249px; position: absolute;
top: 101px" Width="798px" CellPadding="4" ForeColor="#333333" GridLines="None" Height="183px" AutoGenerateSelectButton="True">

<Columns>
<asp:TemplateField HeaderText="Open Chart">
<ItemTemplate>
<asp:HyperLink
ID="myHyperLink"
runat="server"
ImageUrl="images/Folder.gif"
Target="_blank"
NavigateUrl="Default2.aspx" />

</ItemTemplate>
</asp:TemplateField>


VB behind.
Protected Sub gvPatientsCharts_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvPatientsCharts.SelectedIndexChanged

Dim gridrow As GridViewRow = gvPatientsCharts.SelectedRow

Session.Add("Person_id", gridrow.Cells(3).Text)

Session.Add("Practice_id", gridrow.Cells(4).Text)

Response.Redirect("Detail.aspx")

End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.