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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:06:20+00:00 2026-05-16T22:06:20+00:00

I have the following function signuture: public JsonResult PopulateGrid(int page, Guid? accountId, Guid? systemUserId,

  • 0

I have the following function signuture:

public JsonResult PopulateGrid(int page, Guid? accountId, Guid? systemUserId, Guid? branchId, DateTime? fromDate, DateTime? toDate, HomeVisitType? homeVisitType)

Every single parameter is bound just fine except toDate which turns out to be always null.
When inspecting the Request.QueryString["toDate"] it retrives the right value which is 30/09/2010.
It seems that DateTime expects another format when binding.
What is the right format?

  • 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-05-16T22:06:20+00:00Added an answer on May 16, 2026 at 10:06 pm

    A quick test on my system shows that it expects the data in MM/DD/YYYY and not DD/MM/YYYY which is probably why you’re having problems. My guess is that if you try the same date on the fromDate you’ll also have the same null issue.

    I’ve changed the current culture in my app to one that uses the DD/MM/YYYY and it seemed to have no effect. Seems to have the same problem with the , decimal for a language that uses 10,01 instead of 10.01…

    Update from someone a developer on the ASP.Net team.

    "This is intentional. Anything that is part of the URI (note the ‘Uniform’ in URI) is interpreted as if it were coming from the invariant culture. This is so that a user in the U.S. who copies a link and sends it over IM to a friend in the U.K. can be confident that his friend will see the exact same page (as opposed to an HTTP 500 due to a DateTime conversion error, for example). In general, dates passed in RouteData or QueryString should be in the format yyyy-mm-dd so as to be unambiguous across cultures.

    If you need to interpret a QueryString or RouteData parameter in a culture-aware manner, pull it in as a string, then convert it to the desired type manually, passing in the desired culture. (DateTime.Parse has overloads that allow you to specify a culture.) If you do this, I recommend also taking the desired culture as a QueryString or a RouteData parameter so that the ‘Uniform’ part of URI isn’t lost, e.g. the URL will look something like …?culture=fr-fr&date=01-10-1990."

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C function with the following signature: int my_function(int n, struct player
I have following function in one Activity public void AppExit() { Editor edit =
I have the following function: func fitrange(a, x, b int) int { if a
I have the following C function: int w_ei_connect_init(ei_cnode* ec, const char* this_node_name, const char
Is it possible to have a TLD map to the following function: public static
I have a method with the following signature: public Guid FindTermIDFromCustomProperty() { // Logic
I have an action method in my UpdatesController with the following signature: public JsonResult
I have the following model : class Model extends BaseModel { public function save($conn
We have a VB.net function with the following signature in class InitializerFactory: Public Shared
I have the following native function interface in C++: int func1(void* param, int sizeOfParam).

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.