This is a migrated thread and some comments may be shown as answers.

Refer ASMX service under Client Side DataBinding

1 Answer 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jaish
Top achievements
Rank 1
Jaish asked on 28 Mar 2015, 03:12 PM
I have an ASMX service inside same scope of my UI layer and using below lines to refer it and pull data for client side binding. No errors and no data too. What's wrong?

<telerik:RadGrid ID="SourceGrid" runat="server" ShowGroupPanel="false" AllowSorting="false" ShowFooter="true" AllowPaging="false" HeaderStyle-CssClass="tableHeading br" AutoGenerateColumns="false" GridLines="Both" EnableViewState="false">
<ClientSettings>
<DataBinding Location="Employee.asmx" SelectMethod="GetEmployees" >


[WebMethod]
public static List<Employee> GetEmployees()
{
List<Employee> employeeList = new List<Employee>();
for (int i = 0; i < 100; i++)
{

employeeList.Add(new Employee { EmpNumber = i, Name = "John" + i, Age = 30, Designation = "Clerk" + i, Salary = 2000 });
//    employeeList = new List<Employee> { 

//new Employee{ EmpNumber=1000, Name="John", Age=30, Designation="Clerk", Salary=2000},
//new Employee{ EmpNumber=1001, Name="Mary", Age=35, Designation="Programmer", Salary=4000},
//new Employee{ EmpNumber=1002, Name="Joe", Age=40, Designation="Manager", Salary=6000},
//new Employee{ EmpNumber=1003, Name="Mike", Age=45, Designation="Head", Salary=9000},
//new Employee{ EmpNumber=1004, Name="Leena", Age=28, Designation="DBA", Salary=3000},
//new Employee{ EmpNumber=1005, Name="Mark", Age=30, Designation="Tester", Salary=3000},
//new Employee{ EmpNumber=1006, Name="Hany", Age=31, Designation="Programmer", Salary=4000},
//new Employee{ EmpNumber=1007, Name="Tiaa", Age=45, Designation="Manager", Salary=6000},
//};
}


return employeeList;
}

1 Answer, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 01 Apr 2015, 01:37 PM
Hello Jaish,

Based on the provided description it would be hard to pinpoint why the data is not displayed.

Nevertheless, make sure that the ScriptService attribute is applied to the Web Service class. For convenience I have prepared a sample Web Site Project where the functionality is implemented. Try to use similar approach and you should be able to implement the behavior you are looking for.

Regards,
Viktor Tachev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Grid
Asked by
Jaish
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or