This a service function “GetTaskProgress”:
[WebMethod]
public IList<OrderViewDTO> GetTaskProgress(DateTime xDATEx)
{
try
{
return new OrderDataRepository()
.GetAllOrderData()
.Where(x => x.POD_DATE == xDATEx)
.GroupBy(o => o.User)
.Select(g => new OrderViewDTO
{
DriverId = g.Key.Id,
PdriverName = g.Key.Name,
OrderCount = g.Count(),
OrderCountWhereNameIsNotNull = g.Count(o => o.RECEIVE_NAME != null)
})
.ToList();
}
catch (Exception e)
{
throw WrapException(e);
}
}
This is the code of the jquery load button:
$('#LoadButton').click(function () {
var DateTime = $('#DateInput').val();
if (DateTime == '')
{
alert('PLEASE ENTER DATE');
}
else {
_Services.invoke({
method: 'GetTaskProgress',
data: { DateTime: DateTime },
success: function () {
alert(DateTime);
How do I call GetTaskProgress with a jQuery function that will pass the “date” into xDATEx?
at the moment when i click on the button i have the bug Invalid web service call, missing value for parameter: ‘xDATEx
I’m not sure about
_Services.invoke()(analogous to$.ajax()perhaps?), but you probably need to change your data parameter to match your service method parameter. Try this