点击gridview中的更新命令我没有得到唯一的日期,但也得到时间。 [英] On click of update command in gridview i am not getting the only date, but also getting time.
问题描述
我在网格中使用模板字段,EditItemTemplate是文本框。在ItemTemplate中,它是标签。在标签中使用 Text ='<%#Eval(Dateofbirth,{0:d})%>',我已将日期格式化为dd / mm / yyyy格式。 />
我正在使用现有日期填充该文本框但在这里我也有时间。
Ex。 6/11/1965 12:00:00 AM但我只需要6/11/1965。
请帮忙。
我尝试过:
Text ='<%#Eval(Dateofbirth,标签中的{0:d})%>'即itemtemplate,我已将日期格式化为dd / mm / yyyy格式。
I am using template field in grid, EditItemTemplate is textbox. In ItemTemplate it is label. Using Text='<%# Eval("Dateofbirth","{0 : d}") %>' in label I have formatted the date in dd/mm/yyyy format.
I am poplulating that textbox with the existing date but here I am getting time as well.
Ex. 6/11/1965 12:00:00 AM but I need only 6/11/1965.
Please help.
What I have tried:
Text='<%# Eval("Dateofbirth","{0 : d}") %>' in label i.e. itemtemplate, I have formatted the date in dd/mm/yyyy format.
推荐答案
Text='<%#Eval("Dateofbirth","{0 : dd/MM/yyyy}") %>'
>
这篇关于点击gridview中的更新命令我没有得到唯一的日期,但也得到时间。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!