Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8460885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:43:40+00:00 2026-06-10T13:43:40+00:00

I use the jquery ui controls. I have a datepicker and I retrieve the

  • 0

I use the jquery ui controls.
I have a datepicker and I retrieve the date as follows:

var sDate = $("#startDatePicker").datepicker('getDate'); 
var eDate = $("#endDatePicker").datepicker('getDate');

which as an example for sDate returns

Tue Aug 14 00:00:00 UTC+0200 2012

I call the code from the web page as follows

$.ajax(
{
  url: '@Url.Action("LogsView","Home")',
  type: 'POST',
  data: { startDate: sDate, endDate: eDate },
  success: function(result) { alert(result); },                        
  error: function(param1) { alert(param1); }
});

I have a controller with the following action

public JsonResult LogsView(DateTime startDate, DateTime endDate)
{   
  var items = FetchItems(startDate, endDate);
  return Json(items, JsonRequestBehavior.AllowGet);
}

When I run it, part of the error that is returned is as follows (when vied in fiddler):

The parameters dictionary contains a null entry for parameter 'startDate' of non-nullable type 'System.DateTime' for method 'System.Web.Mvc.JsonResult LogsView(System.DateTime, System.DateTime)' ..

I’ve check my params sent via fiddler and it is as follows startDate=&endDate=

Anyone know how to format and pass in the date correctly (I assume this is where the error lies)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:43:42+00:00Added an answer on June 10, 2026 at 1:43 pm

    I needed to add .toJSON() to $("#startDatePicker").datepicker('getDate')
    i.e. $("#startDatePicker").datepicker('getDate').toJSON()

    if you get an error on the toJSON() function then try

    var sd = $("#startDatePicker").datepicker('getDate');
    var sDate = $.datepicker.formatDate('dd-MM-yy', sd);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net user control on which I want to use jquery ajax.
I have several Telerik's DropDownList controls which are rendered inside jQuery dialog It is
I use jquery flot for my pie charts and I have a problem with
I am converting an existing ASP.NET website to use jQuery Mobile controls. The first
I have an ASP.NET server control which relies on JQuery for certain functionality. I've
I have an ASP.NET page that's going to use Html controls to render a
I have a user control that creates a jQuery DatePicker (standard one in the
I have been using the jQuery date picker for a while and its great.
I have this Editor Template so that I have a datepicker set for date
I'm trying to use jQuery to intercept control-A keypresses on my web page, like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.