Click here to Skip to main content
15,916,941 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

You should handle your date in code behind as a DateTime 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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900