MVC下自定義ModelState驗證擴展方法

MVC下能夠經過對ModelState.IsValid方法進行驗證模型,當咱們設計好一個模型而且經過引用this using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; 設置好相應的特性時,Action中經過ModelState.IsValid就能夠對此模型進行
相關文章
相關標籤/搜索