<%= Html.ActionLink(Html.Encode("user3"),
"Filter", new { controller = "Search",
userName = "user3",
dateFrom = DateTime.Now.AddDays(-2).ToString(),
dateTo = DateTime.Now.ToString() })%>
It's evaluated to this link:
http://localhost:60357/Search/Filter?userName=user3&dateFrom=08.02.2010%2023%3A21%3A33&dateTo=10.02.2010%2023%3A21%3A33
I have to notice that current Globalization settings in Windows are set up to european date format. So 08.02.2010 = 08 Feb 2010.
But in the action method
public ActionResult Filter(String userName, DateTime dateFrom, DateTime dateTo)
dateFrom has the value 02.08.2010 = 02 Aug 2010
It's incorrect. Is it framework bug? So what is the best way to solve this issue? I don't want to write some monkeypatch if possible.