**I want to Perform validation based on condition in ASP.NET MVC.**

I have same page and model for Insert and update record, Now i want to set required field based on condition.

At time of insertion, EmployeeCode is Required, but at the time of Updation i don't want to set EmployeeCode is Required.

**How can i perform validation like this case in asp.net mvc?**