Unable to set datetime format in MVC 4 using data annotations

前端 未结 3 1690
暖寄归人
暖寄归人 2020-12-14 09:41

I will try everything but not working this(dd/MM/yyyy) date format, this always gate mm/dd/yyyy

[Display(Name = \"Release D         


        
3条回答
  •  盖世英雄少女心
    2020-12-14 10:09

    If you use data-annotation. when display it good. but when edit mode. it still use server format (culture setting) DisplayFormat: like it name, only for display

    There are some option to solve. - paste to server as string with your favorite format - write customer bindding - Setting globalization in web.config for Format : dd/MM/yyy i using setting bellow

    
        
    ....
    

提交回复
热议问题