Hi,
I have a RadGrid in my ASP.Net web form.
Now i want to bind this on client-side through a AjaxEnabledWCFService.
After all the implementations done it seems the data is being retrieved through the response
but rather than showing it in the grid it shows an message like "Method not allowed.".
I could not able to find the actual reason behind this error, and what is the cause for dat not being populated.
Here are the details of my implementations :-
I have added the particular service to the Script manager like below :-
Then added the service to the RadGrid ClientEvents - DataBindings tag like below :-
I have a service named CustomerListService with DataContract as order,
ServiceContract as GetCustomers() as below codes :-
Ex:
The settings in the configuration file are like below :-
Please let me know if anyone having any suggestions here and also i need to know how to pass the parameter to the service method to
get the values as per the parameter supplied.
Thanks in advance.
I have a RadGrid in my ASP.Net web form.
Now i want to bind this on client-side through a AjaxEnabledWCFService.
After all the implementations done it seems the data is being retrieved through the response
but rather than showing it in the grid it shows an message like "Method not allowed.".
I could not able to find the actual reason behind this error, and what is the cause for dat not being populated.
Here are the details of my implementations :-
I have added the particular service to the Script manager like below :-
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Services
>
<
asp:ServiceReference
Path
=
"~/services/CustomerListService.svc"
/>
</
Services
>
<
Scripts
>
<%--Needed for JavaScript IntelliSense in VS2010--%>
<%--For VS2008 replace RadScriptManager with ScriptManager--%>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
Then added the service to the RadGrid ClientEvents - DataBindings tag like below :-
<
DataBinding
SelectMethod
=
"GetCustomers"
Location
=
"~/services/CustomerListService.svc"
SortParameterType
=
"Linq"
FilterParameterType
=
"Linq"
>
</
DataBinding
>
I have a service named CustomerListService with DataContract as order,
ServiceContract as GetCustomers() as below codes :-
Ex:
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class CustomerListService
{
[OperationContract]
public List<
Customer
> GetCustomers()
{
CustomerData CustData = new CustomerData();
System.Data.DataTable dt = CustData.GetCustomersList(1, 1, "");
List<
Customer
> Customerist = new List<
Customer
>();//Here Customer is DataContract
foreach (System.Data.DataRow dr in dt.Rows)
{
Customer cust = new Customer();
SetPropertiesFromOrderRow(cust, dr);//set all the property values from DataRow to Order
CustomerList.Add(cust);
}
return CustomerList;
}
}
The settings in the configuration file are like below :-
<
endpointBehaviors
>
<
behavior
name
=
"ClientSideBindingTest.services.CustomerListServiceAspNetAjaxBehavior"
>
<
enableWebScript
/>
</
behavior
>
</
endpointBehaviors
>
<
services
>
<
service
name
=
"ClientSideBindingTest.services.CustomerListService"
>
<
endpoint
address
=
""
behaviorConfiguration
=
"ClientSideBindingTest.services.CustomerListServiceAspNetAjaxBehavior"
binding
=
"webHttpBinding"
contract
=
"ClientSideBindingTest.services.CustomerListService"
/>
</
service
>
</
services
>
Please let me know if anyone having any suggestions here and also i need to know how to pass the parameter to the service method to
get the values as per the parameter supplied.
Thanks in advance.