Last post Mar 25, 2020 06:20 AM by AddWeb Solution
Mar 18, 2020 07:43 AM|shijostephen|LINK
ModelState.Clear() not working
public ActionResult check(string UserName,string Password)
BSSCom_UserRegisterDTO user = new BSSCom_UserRegisterDTO();
user.Listlogindepartments = new List<BSSCom_LoginDepartmentsDTO>();
user.ListloginYears = new List<BSSCom_LoginYearDTO>();
Thanks & Regards
Mar 18, 2020 11:17 AM|mgebhard|LINK
ModelState.Clear() works as written exactly as written in the openly published documentation. ModelState is the state of a model after binding to a property in an Action method. You design does not bind a Model in the Action.
Mar 18, 2020 02:55 PM|bruce (sqlwork.com)|LINK
Whats not working?
in your sample code ModelState represents the state of binding the two parameters
UserName and Password. If you check the ValueProvider, you will see an entry for each. the code:
makes no sense as "DepartmentCd" was not a binding parameter. The ModelState.Clear(), just clears the error collection.
Mar 25, 2020 06:20 AM|AddWeb Solution|LINK
As per your requirement suggest a link.
A link has step by step information to clear model.
If you want to still any help let us know.