I have startdate in QueryString with value: 3/1/2012
DateTime.Parse(Re
The default model binder always uses InvarianCulture when parsing query string values, no matter which culture you configured in your web.config.
So assuming you have the 2 actions:
[HttpGet]
public ActionResult Foo(DateTime date)
{
...
}
[HttpPost]
public ActionResult Bar(DateTime date)
{
...
}
when you invoke the Foo action you should always use the invariant culture to format the date in the query string, whereas when you invoke the Bar action and pass the date parameter in the POST body payload, the default model binder will use the culture configured in your web.config.
Take a look at the following blog post which covers this in more details.