My application is in Asp.Net MVC3 coded in C#.Net. Off Late i'm facing a issue related with the date format of the client machine.
Two Scenarios :
- If the solution is published on my company's server, then in that scenario i don't need to worry regarding the format of the date and the issues related to it, as i know in which format is my server / machine's date is set.
My Issue
If i have to publish the content on any customers machine, then at the time of installation i can probably set the date format of the customer's machine as per my applications requirement.
But one such scenario has been encountered and that is, if the user of the customer machine changes the date format then we get the problem in posting the data to the controller or any other
Json
method.
Example:1
$("#My_Control").load("/../My_Controller/My_Method", { My_Variable: $("#My_DatePicker_value").val()}, function () { });
Above is my Jquery
code which passes a certain date to one of my method, but if the date format at the customer machine does not matches with the format in my jquery code then it is not visiting the Json method.
Example:2 (Sample Code)
[HttpPost]
public ActionResult Create(MyEntity Entity_Object)
{
return View()
}
In the above scenario, if the date format of the posted date and the format of the customer's machine does not match then the Entity_Object is showing that values as NULL
Following are the links i have gone through:
Suggest if it is possible and how.