click on load more button when user click on bottom

Last Reply on Mar 04, 2016 08:08 AM By Shashikant

Posted on Mar 01, 2016 04:13 AM



i have link button at last of page when user click on link button it clicks more data.


what i want is when user reach on bottom so load more button click automatically.

Posted on Mar 03, 2016 10:21 AM Modified on on Mar 03, 2016 10:22 AM


Please refer below code.


    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        $(function () {
            $(window).scroll(function () {
                if ($(document).scrollTop() + $(window).height() >= $("body").height()) {
    <asp:ListView ID="ListView1" runat="server">
            <asp:Label ID="Label2" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "MyProductId") %> '
            <div class="white-panel">
                <%--<img src="" alt="">--%>
                <asp:ImageButton ID="ImageButton2" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Image") %> '
                    CssClass="img" CommandName="ViewProduct" runat="server" />
                <p style="text-transform: capitalize; font-size: 11px; text-align: left;">
                    <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "UserName") %> '
                    <asp:Label ID="Label3" runat="server" Text="wants"></asp:Label>
                    <asp:LinkButton ID="LinkButton4" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Description") %> '
                        ForeColor="#333333" Font-Italic="True" CommandName="ViewProduct"></asp:LinkButton>
                    and what make it special is
                    <asp:LinkButton ID="LinkButton6" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Special") %> '
                        ForeColor="#333333" Font-Italic="True"></asp:LinkButton>
                    <asp:LinkButton ID="LinkButton8" runat="server" CssClass="text-danger pull-right"
                        Font-Size="X-Small" ForeColor="#9900CC" CommandName="ViewProduct">View</asp:LinkButton></p>
                <hr />
                <div class="row">
                    <div class="col-xs-3" style="padding: 0px;">
                        <asp:LinkButton ID="LinkButton3" runat="server" CommandName="favorite" ForeColor="White"
                            Font-Size="X-Small" CssClass="btn btn-warning pull-left"> <span class="glyphicon glyphicon-heart" aria-hidden="true"></span> <%# DataBinder.Eval(Container.DataItem, "fav") %> </asp:LinkButton>
                    <div class="col-xs-3" style="padding: 0px;">
                        <i class="fa fa-eye btn btn-success">
                            <asp:Label ID="Label5" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "totalviews") %> '
                    <div class="col-xs-3" style="padding: 0px;">
                    <div class="col-xs-4" style="padding: 0px;">
                        <asp:LinkButton ID="LinkButton5" runat="server" CssClass="text-danger pull-right"
                            Font-Size="X-Small">Report Spam</asp:LinkButton>
    <div class="loadmore">
        <asp:LinkButton ID="LinkButton7" runat="server" OnClick="LinkButton7_Click" ForeColor="#333333">Load More</asp:LinkButton>
        <asp:DataPager ID="DataPager2" runat="server" PagedControlID="ListView1" PageSize="20">
                <asp:NextPreviousPagerField ButtonType="Image" ShowPreviousPageButton="false" PreviousPageText=""
                    NextPageText="Load More" Visible="False" />

I hope this will help you out.


Posted on Mar 04, 2016 08:08 AM

You need to use below code.


javascript: __doPostBack('<%= LinkButton7.UniqueID %>', '')

to post back after document reach the bottom,but you need to rebind data to Datalist.