Avatar of DanGettel
DanGettel

asked on 

Using Cross-Page Postback to access gridview selected row values from previous page

I am having some problems figuring out how to use Cross-Page Postback to access the gridview selected row values in code behind from the previous page. The current columns of the gridview that appears on the first page are displayed below.  

What I would like to do is access the FirstName, LastName, and Report values for the selected row on the second page.

I have used Cross-Page Postbacks before, but not to do something like this with a gridview.

Thanks for the help.

<Columns>
	<asp:TemplateField ShowHeader="False">
        <ItemTemplate>
            <asp:LinkButton ID="ID"  DataTextField="ID" runat="server" CausesValidation="False" 
                CommandName="Select" Text="Select" PostBackUrl="reschedule_appointment_form.aspx"></asp:LinkButton>
        </ItemTemplate>
    </asp:TemplateField>
	<asp:boundfield DataField="Time" SortExpression="Time" HeaderText="Time">
	</asp:boundfield>									
	<asp:boundfield DataField="Day" SortExpression="Day" HeaderText="Day">
	</asp:boundfield>
	<asp:boundfield DataField="DateTextShort" SortExpression="DateTextShort" HeaderText="DateTextShort">
	</asp:boundfield>
	<asp:boundfield DataField="FirstName" SortExpression="FirstName" HeaderText="FirstName">
	</asp:boundfield>
	<asp:boundfield DataField="LastName" SortExpression="LastName" HeaderText="LastName">
	</asp:boundfield>
	<asp:checkboxfield DataField="First" SortExpression="First" HeaderText="FirstApt">
	</asp:checkboxfield>
	<asp:checkboxfield DataField="Report" SortExpression="Report" HeaderText="Report">
	</asp:checkboxfield>
</Columns>

Open in new window

.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
avnish_tanna

8/22/2022 - Mon