This question is locked. New answers and comments are not allowed.
Hello, i'm facing whit one problem when passing the value of datetimepicker to controller.
this is a little sample that isn't working.
I'm using a strongly type view with my dto object and i have a controller action that accepts dto as parameter.
Every property loaded from other control different than dateTimePicker are populated, but dateTime Values are equal to C# min date.
| <p> |
| <label for="dataInicio"><%=SIG.App_GlobalResources.Resources.ementa_C_labelDataInico %></label> |
| <%=Html.Datepicker("DataInicio", DateTime.Now.ToString())%> |
| <label for="dataFim"><%=SIG.App_GlobalResources.Resources.ementa_C_labelDataFim %></label> |
| <%=Html.Datepicker("DataFim", DateTime.Now.ToString())%> |
| </p> |
| <p> |
| <label for="descricao">descricao:</label> |
| <%= Html.TextBox("descricao") %> |
| <%= Html.ValidationMessage("descricao", "*") %> |
| </p> |
Controller action
| [AcceptVerbs(HttpVerbs.Post)] |
| public ActionResult SaveTempEmenta(Ementa ementa) |
| { |
| return View(); |
| } |
Another problem related to dateTimePicker is Globalization. I don't understand why my control is in French.
How can i change localization at run time?
Hope someone can help.
Best Regards