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 8706597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:39:09+00:00 2026-06-13T03:39:09+00:00

Is it possible to post a DateTime parameter to a Web Method inside an

  • 0

Is it possible to post a DateTime parameter to a Web Method inside an ASMX web service (using a JSON serialized RPC style call)?

I am sending a DateTime to the browser and this gets serialized in the form /Date(1350639464100+0100)/. I can then use the excellent moment.js library to parse the date, display it on the page etc.

My problem is returning this date to the server using an AJAX post to my web service. My web method looks something like this:

[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public void Save(DateTime date)
{
    // Do stuff
}

If I try to send a date in the same format as it came down (/Date(1350639464100+0100)/) then I get an error:

/Date(1350639464100+0100)/ is not a valid value for DateTime.

Are there any better alternatives to sending this up as a string and then parsing the value on the server? Ideally I’d like to be able to send objects on a round trip to and from the server without having to alter any date properties that they may contain.

Thanks for any help!

  • 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-13T03:39:10+00:00Added an answer on June 13, 2026 at 3:39 am

    You can change the parameter type to string and then you can convert that string to any type you want

       public void Save(String date){
         *Code*
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to post a message on the wall of the group, using
Using JavaScript SDK, it is possible to wall post with user's consent. Since It
Within a web form I have the following jQuery setup to call a method
Is it possible to post an array of JSON strings to MVC3 without a
is it possible to post to the wall (using the graph api) when the
Is it possible to Post some data from window based app to a web-server
Possible Duplicate: Post Increment and Pre Increment concept? I cant understand how the if
Is it possible to post binary files (such as images) to GitHub gists via
Possible Duplicate: Read Post Data submitted to ASP.Net Form I have a google checkout
Possible Duplicate: JavaScript post request like a form submit I have a value calculated

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.