Users Pricing

forum

How to manually check if model is valid or not

Anonymous User 1702 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?


2 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md