Monday, April 4, 2016

Concert crowd
Hi Folks,
If you want to access the ModelState property in the View , you can use the ModelState in your Razor View as depicted below in image:

This is the source code as shown below:
  1. @model IEnumerable<MVCSample.Models.EmpRegistration> 
  2. @{ 
  3.     ViewBag.Title = "Verify"; 
  4. if (@ViewContext.ViewData.ModelState.IsValid) 
  5.     { 
  6.         ViewBag.Title = "Verify"; 
  7. if (TempData["EmployeeRegistration"] != null) 
  8.         { 
  9.             var tempDataEmployeeRegistration = TempData["EmployeeRegistration"]; 
  10.         } 
  11.     } 
    Thanks
To learn more about MVC please go to the following link.
MVC Articles
Thanks.
Enjoy coding and reading.

1 comment :

  1. I feel happy about and I love learning more about this topic. keep sharing your information regularly for my future reference. This content creates a new hope and inspiration with in me. Thanks for sharing article like this.

    informatica training in Mylapore

    ReplyDelete