Hi i am trying to get gried view data from data base numericaly onfter another. For example first 5 data then another five (6 to 10) then again. I am trying this by clicking on link button but page can not be refresh..i get id from session in manual data source of gried view.
'vb code..
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Me.IsPostBack = False Then
            id = 5
        End If
        Session.Add("gid", " " & id & " ")
    End Sub

    Protected Sub LinkButton3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton3.Click
        MsgBox(" link 2 is clicked")

        id = Integer.Parse(Session.Item("gid").ToString()) + 5

    End Sub

' this is data source query
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:MBHConnectionString %>" 

                    SelectCommand="SELECT * FROM [Softwares] WHERE ([Soft_id] &lt;= @Soft_id and [Soft_id] &gt;= @Soft_id-5) ORDER BY [Soft_id]">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="1" Name="Soft_id" SessionField="gid" 
                            Type="Int32" />
                    </SelectParameters>
    </asp:SqlDataSource>

Try using GridPageIndexing Event

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.