I have gridview that I am using paging on. I want to pass along the current page in a asp:Hyperlink so I can send them back to the current page when they are done viewing the details of a record. Is this possible? If it is how can I do this?
<asp:GridView ID='grdObitList' runat='server' allowpaging='true' PageSize='10' AutoGenerateColumns='false' CssClass='grdClass' BorderStyle='None' GridLines='None' CellSpacing='2' > <PagerStyle HorizontalAlign='Center' /> <PagerSettings Position='Bottom' FirstPageText='First' LastPageText='Last' Mode='NumericFirstLast' /> <Columns> <asp:HyperLinkField HeaderText='Name' DataTextField='obit_fullname' DataNavigateUrlFields='obit_id' DataNavigateUrlFormatString='obitDisplay.aspx?oid={0}' /> <asp:BoundField ReadOnly='true' HeaderText='Date' DataField='obit_dod' DataFormatString='{0:d/M/yyyy}' /> <asp:BoundField ReadOnly='true' HeaderText='Resident Of' DataField='obit_resident' /> <asp:BoundField ReadOnly='true' HeaderText='Funeral Home' DataField='obit_funeralhome' /> </Columns>
One way to do it is converting it to a template column, that way you can use normal databind syntaxt to get to it (<%#)