- Create Identity Models through Scaffolding Free15 m 31 s
- Create Domain Models using Scaffolding Free12 m 59 s
- Display List of Products in a Table15 m 57 s
- Add New Product Functionality
- Add Standard and Custom Validations Free12 m 32 s
- Add Select List Component to Display Categories10 m 56 s
- Delete Products7 m 7 s
- Update Products12 m 33 s
- Enable Search Functionality Free16 m 18 s
Episode Description
What is a form without necessary Validations?
When you are building a web application, it is important to have validations in place to ensure that the data being submitted is accurate. This is especially important when you are dealing with sensitive information such as credit card numbers or password. By using validations, you can help to protect your users' data and keep your application secure.
Focus on important code:
//custom validation List listProduct = _Dbcontext.Product.FromSqlRaw("Select * from Product Where ProductName ='" + product.ProductName.Trim() + "'").ToList(); if (listProduct.Count > 0){PopulateCategories(); ModelState.AddModelError("ProductName", "Product Name already exists in table"); return View(product); }//end of vaidation