WebForms UnobtrusiveValidationMode Error and Solution

by Admin April 25, 2015

Visual Studio can create a .net project in 2013 a web page within the validation control (validation control) object when you run the page “when you add WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for the ‘ jquery ‘. Please add a ScriptResourceMapping named jquery (case – sensitive). “as you experience with an error. 

error image

Two different solutions for this error I’m going to share with you a way. The first of these is in the root folder of your project’s Web.config file into <appSettings> <add key="ValidationSettings:UnobtrusiveValidationMode" value="None”></add> </appSettings> line on the closing of the code to add anywhere before.

After you have added this code, your site needs to be running. But shall be referred to the possibility of work in the second solution I share with you.

We will be using jquery in this solution. If you can not find your system files if jquery URhttp://code.jquery.com/jquery-1.8.1.js javascript file located at our project we’re making, preferably into the Scripts folder,. Then project the global.asax file is not available we will add this file. To add this file to the project in Solution Explorer after right clicking on the name of the Add-Add New item, select Global Application Class from here choose the Add button, we included in our project our global.asax file.

Now the Application_Start method in the global.asax file for the following codes below.

        ScriptManager. Scriptresourcemapping.adddefinition ("jquery", new ScriptResourceDefinition
        {
            Path = "~/Scripts/jquery-1.8.1.js",
            Debugpath = "~/Scripts/jquery-1.8.1.js",
            Cdnpath = "URhttp://code.jquery.com/jquery-1.8.1.js"
            Cdndebugpath = "URhttp://code.jquery.com/jquery-1.8.1.js"
        });

Here is the version of Jquery being used, according to him, let’s not forget that we need to update our code.

Yasin NAR

Leave a Comment

Your email address will not be published. Required fields are marked *