ASP.Net MVC model binding - how to change date format?

后端 未结 3 701
长发绾君心
长发绾君心 2021-01-02 19:10

I have this application, and the default date format must be dd/MM/yyyy (the language is Brazilian Portuguese).

I already had set culture and UI culture

3条回答
  •  粉色の甜心
    2021-01-02 19:30

    I found what happended. My form was posting via GET method, and the MVC just uses the culture for an action parameter when it's passed in the RouteData or by the form via POST method.

    I just changed the form to POST method and it worked.

提交回复
热议问题