标签:
view
<script type="text/javascript"> $(function () { var date = ‘@ViewData["endDate"]‘; //后台格式处理以后yyyy-MM-dd $("#endDate").datebox(‘setValue‘, date); }) </script> <input class="easyui-datebox" type="text" id="endDate" name="endDate" />
Controller
User user = client.GetUser(id.ToString()); string pwd = client.DecryptPsd(user.U_ID.ToString()); ViewData["u_psd"] = pwd; ViewData["birth"] = user.birth.ToString("yyyy-MM-dd"); ViewData["endDate"] = user.CreateDate.ToString("yyyy-MM-dd"); //格式要限制成yyyy-MM-dd,前台才显示
注意:要将日期转化成yyyy-MM-dd的格式前台才能正确显示
标签:
原文地址:http://www.cnblogs.com/syzx/p/4766796.html