Hi there,
I've wired up my radgrid to run off a webservice in the code behind file.
But when I create a webservice and place it into a different location then my radgrid doesn't populate. I'm obviously not connecting it properly.
Here is my ASPX:
That works but if I change Location="Default.aspx" to Location="Products.asmx" then my grid doesn't populate.
Here is my Products.asmx:
Thanks in advance for taking the time to help me out.
D
I've wired up my radgrid to run off a webservice in the code behind file.
But when I create a webservice and place it into a different location then my radgrid doesn't populate. I'm obviously not connecting it properly.
Here is my ASPX:
| <ClientSettings> |
| <DataBinding Location="Default.aspx" SelectCountMethod="GetProductCount" SelectMethod="GetProducts"> |
| </DataBinding> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
That works but if I change Location="Default.aspx" to Location="Products.asmx" then my grid doesn't populate.
Here is my Products.asmx:
| [WebService(Namespace = "Products")] |
| [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] |
| // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. |
| [System.Web.Script.Services.ScriptService] |
| public class Products : System.Web.Services.WebService { |
| [WebMethod] |
| public static IEnumerable GetProducts(int startRowIndex, int maximumRows) |
| { |
| var northwind = new NorthwindDataContext(); |
| var products = from p in northwind.Products |
| select new |
| { |
| ProductID = p.ProductID, |
| Name = p.ProductName, |
| CategoryName = p.Category.CategoryName, |
| Price = p.UnitPrice, |
| UnitsInStock = p.UnitsInStock |
| }; |
| return products.Skip(startRowIndex).Take(maximumRows); |
| } |
| [WebMethod] |
| public static int GetProductCount() |
| { |
| var northwind = new NorthwindDataContext(); |
| var count = northwind.Products.Count(); |
| return count; |
| } |
| } |
Thanks in advance for taking the time to help me out.
D