How to concatenate a datetime into a textbox in c# asp.net to show just date -
how concatenate nullable datetime textbox in c# asp.net show date? when load date textbox below in textbox:
2014-04-26 00:00:00.000
but want date ideas? cant tostring display want. calling value below:
txtdateexpected.text = loadvisitdetails.expecteddate.tostring();
you can date part using date
property of datetime
class:
txtdateexpected.text = loadvisitdetails.expecteddate != null ? loadvisitdetails.expecteddate.date.tostring() : "";
or:
if(loadvisitdetails.expecteddate != null) txtdateexpected.text = loadvisitdetails.expecteddate.date.tostring();
Comments
Post a Comment