view

<script type="text/javascript">
        $(function () {           

            var date = '@ViewData["endDate"]';     //后台格式处理以后yyyy-MM-dd   
            
            $("#endDate").datebox('setValue', date);
           
        })
    </script>

 <input class="easyui-datebox" type="text"  />

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的格式前台才能正确显示

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-09-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-16
  • 2021-09-07
  • 2021-10-13
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案