Skip to content

Data load inside data list when page is scroll in c#

Devendra  Kumar

Devendra Kumar

Asked Sep 7, 2016, 1:48 AM EDT2 answers
Share
LinkedInX
data load inside datalist when page is scroll 
 
use this link but not work
www.aspsnippets.com/.../Load-images-while-scrolling-page-down-with-jQuery-AJAX... 

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Devendra  Kumar
    0
    i will use this page like:
    <%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMaster.master" AutoEventWireup="true"
    CodeFile="Default6.aspx.cs" Inherits="Default6" %>
    CellPadding="2" CellSpacing="20">
    <%--
    --%>
    and code behind code like
    ============================================
    C#
     protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dlImages.DataSource = GetCustomersData(1);
                dlImages.DataBind();
            }
        }
    
        public static DataSet GetCustomersData(int pageIndex)
        {
            string query = "[GetProductPageWise]";
            SqlCommand cmd = new SqlCommand(query);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@PageIndex", pageIndex);
            cmd.Parameters.AddWithValue("@PageSize", 10);
            cmd.Parameters.Add("@PageCount", SqlDbType.Int, 4).Direction = ParameterDirection.Output;
            return GetData(cmd);
        }
    
        private static DataSet GetData(SqlCommand cmd)
        {
            string strConnString = ConfigurationManager.ConnectionStrings["FairDecoreConn"].ConnectionString;
            using (SqlConnection con = new SqlConnection(strConnString))
            {
                using (SqlDataAdapter sda = new SqlDataAdapter())
                {
                    cmd.Connection = con;
                    sda.SelectCommand = cmd;
                    using (DataSet ds = new DataSet())
                    {
                        sda.Fill(ds, "Tbl_Products");
                        DataTable dt = new DataTable("PageCount");
                        dt.Columns.Add("PageCount");
                        dt.Rows.Add();
                        dt.Rows[0][0] = cmd.Parameters["@PageCount"].Value;
                        ds.Tables.Add(dt);
                        return ds;
                    }
                }
            }
        }
    
        [WebMethod]
        public static string GetCustomers(int pageIndex)
        {
            return GetCustomersData(pageIndex).GetXml();
        }
    }
    when page scroll then it show message like:
    undefined i'am not understand this means please any body solve this query
    0
  • Devendra  Kumar
    0
    i will use this page like:
     
    i will get error when scroll the page like:
     
    undefined  
    0