Problem with asp.net web services consuming in kendo mobile listview

2 posts, 0 answers
  1. Ashraf Syed
    Ashraf Syed  avatar
    1 posts
    Member since:
    Jul 2009

    Posted 25 Apr 2013 Link to this post

    Hi

    I am trying to call asp.net web services in telerik kendo mobile listview  but i am not  getting any data its showing only loading on page .Please find code with attachment and with web services  .Please check what is issue in that.

    And if you can share sample code from asp.net services with telerik kendo for mobile that will helpful.


    //----------web services ---------------------------
     [WebMethod]
            public string   EmployeeList()
            {
                
                string abc = null;
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                SqlCommand cmd = new SqlCommand("select top 10 Firstname from employee where branchid=@branchid", connection.getConn());
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.AddWithValue("@branchid", 9);
              
                SqlDataAdapter sda = new SqlDataAdapter(cmd);
                DataSet ds = new DataSet();
                sda.Fill(ds);
                for( int i=0;i<ds.Tables[0].Rows.Count ;i++)
                {
                  
                    if (i == 0)
                    {
                        abc = ds.Tables[0].Rows[i]["firstname"].ToString();
                    }
                    else
                    {
                        abc =abc+"," + ds.Tables[0].Rows[i]["firstname"].ToString();
                    }
                }
                string jsonString = serializer.Serialize(abc);
                return jsonString;
            }
  2. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 29 Apr 2013 Link to this post

    Hello,

    I posted my reply in the support ticket on the same topic. For convenience I am pasting it below:

    The service will convert the result to JSON so the result will be wrapped twice. You should leave the service to serialize the data and return just a collection of objects in order to avoid the problem. We do not have examples specifically for Kendo Mobile that use page methods but I can suggest to check the ASP examples from our GitHub repository which can be found on this page. The examples use a Web Grid but the dataSource is the same so you can use the same approach.

    Kind regards,
    Daniel
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top