Step 8 − Now open the Turn Windows Feature on or off and Expand Internet Information Services → World Wide Web Services → Application Development Features.
Model State has two purposes: to store the value submitted to the server, and to store the validation errors associated with those values. When MVC receives a POST, it takes all of the post parameters and adds them to a Model State Dictionary instance. Essentially, MVC is wrapping the user inputs into more server-friendly classes (Model State and Value Provider Result) for easier use. They're used for the second function of Model State: to store the errors found in the submitted values.One of the main issues is that validation can only be done on a model property in isolation.Often we will want to validate a property based on the current value of some other property: for instance we may want our confirm password field value to be the same as the password box.Let’s take a look at a simple example of self-hosting. NET MVC application is completed and you want to use selfhosting, right-click on the Project in the solution explorer. Step 2 − Click the ‘Custom’ option, which will display the New Custom Profile dialog. Step 4 − Select the File System from the Publish method dropdown list and also specify the target location. Step 7 − Click ‘Publish’ button, it will publish the files at the desired location. Step 6 − Check the ‘Delete all existing files prior to publish’ and ‘Precompile during publishing’ checkboxes and click ‘Next’ to continue.