Users Pricing

forum

home / developersection / forums / how to manually check if model is valid or not

How to manually check if model is valid or not

Anonymous User 1652 29 Apr 2018

I want to check the data is valid or not

 public ActionResult ValidCheck(student model)

    {

        Models.ViewModel.User model = new Models.ViewModel.User();
        model.Age = 12;
        model.Name = "Andy He";
        model.Email = "123";
        //TryValidateModel(model);
     }

could you help me?


I am a content writter !


2 Answers