close

        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy/MM/dd}")]      

        //只顯示部分時間資訊 ex:1980/10/2
        [
Required(ErrorMessage = "請輸入BirthDate")]    

         //欄位沒填寫時
       
public Nullable<System.DateTime> BirthDate { get; set; }

        EX:  

         [Required(ErrorMessage = "請輸入姓名")]
         public string EmployeeName { get; set; }

 

 

 

arrow
arrow
    文章標籤
    表單驗證 APS.NET MVC
    全站熱搜

    Wood 發表在 痞客邦 留言(0) 人氣()