Hi,
I am using vb.net code in which I am having a gridview control. Please see the below code
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" CssClass="innerGridTable" DataKeyNames="OrgID" DataSourceID="OrgGridViewDataSource">
<Columns>
<asp:CommandField ShowSelectButton="True" ButtonType="Button" SelectText="Select"
ControlStyle-CssClass="Button">
<ControlStyle CssClass="Button"></ControlStyle>
</asp:CommandField>
<asp:BoundField DataField="OrgName" HeaderText="Organisation Name" SortExpression="OrgName">
</asp:BoundField>
<asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type"></asp:BoundField>
<asp:BoundField Visible="true" DataField="OrgID" HeaderText="OrgID" InsertVisible="False"
ReadOnly="True" SortExpression="OrgID"></asp:BoundField>
<asp:TemplateField Visible="false" HeaderText="RAOG ID">
<ItemTemplate>
<asp:Label ID="lblRAOGID" runat="server" Text='<%# Bind("RAOGID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" HeaderText="RAO ID">
<ItemTemplate>
<asp:Label ID="lblRAOID" runat="server" Text='<%# Bind("RAOID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField Visible="false" DataField="Name" HeaderText="Name" SortExpression="Name">
</asp:BoundField>
</Columns>
</asp:GridView>
Now in paging if user opens a record from 3rd page, it opens perfectally. The problem is that when he comes back to this page again it starts showing first page, infact it would have shown the 3rd page of gridview.
Please suggest the code the same!
Thanks
Best Regards, MS