asp.net mvc 4 - How to Display a mesaage if I tried to save duplicate data into database in mvc4 .NET -


i creating mvc4 project in .net framework.i have html page has text boxes input , below 4 button there save, update, delete, show. working well.

now want put validation in project

  1. if tried save data there(primary key enable in database) message should display "data present" , data should show.
  2. in date column.date should not exceed system date , not less 3 days before date.

  1. create action method in controller takes data , check in
    database dublicate e.g. isrecordexist(parameters)
  2. if data exist in database function should return true else return false
  3. create jquery function checkdublicate() function should return true or false
  4. inside function use ajax() function pass data function in controller return true record exist if false record not in database
  5. now on form submit call checkdublicate() function if return true data exist , show errors using validationengine().

Comments