Date format without time in ASP.NET Gridview

后端 未结 6 1292
Happy的楠姐
Happy的楠姐 2020-11-29 11:50

in ASP.NET gridview binding two dates. I want to display dd/MM/yyyy but it displays 10/03/2014 00:00:00.



        
6条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-29 12:34

    DataFormatString is a property of BoundField control and doesn't affect any other control. You can specify the format in an Eval expression:

    Text='<%# Eval("Fromdate", "{0:dd/MM/yyyy}") %>' />
    

提交回复
热议问题