如何在文本框中访问不同的值? [英] how to access to different values in textbox ?
本文介绍了如何在文本框中访问不同的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hii,
我有一个开始日期文本框。我希望将日期显示为dd-mmm-yy格式,但在后面的代码中我想以dd-mm-yy的形式访问..我该怎么做?
因为之前我正在显示dd-mm-yy作为文本字段,因此eaisy可以在后面的代码中检索相同的值..但现在要求是以不同的格式显示...但是我需要导航每个代码后面的那个并做了改变..请建议
解决方案
你应该在代码后面处理你的日期为DateTime
字段,只使用格式将其呈现给用户(客户端)。
处理字符串表示的日期是一场噩梦,也是一种非常糟糕的做法。
hii ,
i have one start date textbox . in which i want to display date as dd-mmm-yy format , but in code behind i want to access as dd-mm-yy .. how can i do that ?
coz previously i was displaying dd-mm-yy as a text field so was eaisy to retrive the same value in code behind .. but now the requirement is to disply in different format .. but then i need to navigate each code behind for that and made changes .. please suggest
解决方案
You should handle your date in code behind as aDateTime
field, and only use the format to present it to the user (client side).
Handling dates from their string representation is a nightmare and a very bad practice.
这篇关于如何在文本框中访问不同的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文