📌 Introduction

While working with ASP.NET Web Forms, many beginners face the following error when running their project:

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery (case-sensitive).

This error usually appears when:

  • You use validation controls like RequiredFieldValidator

  • jQuery is not properly configured

  • You create a new Web Forms project

  • You update Visual Studio

In this article, we will understand:

  • ✔ Why does this error occurs

  • ✔ When it happens

  • ✔ Two simple solutions

  • ✔ Step-by-step fix

  • ✔ Output before and after fixing

This guide is written in easy language for beginners.

❓ Why This Error Occurs

ASP.NET Web Forms uses something called:

👉 Unobtrusive Validation

Unobtrusive validation depends on:

  • jQuery library

  • jQuery validation scripts

If jQuery is not registered correctly in the project, ASP.NET cannot find it and shows this error.

In simple words:

👉 ASP.NET wants jQuery
👉 jQuery is missing
👉 So it throws an error

🧪 Example Scenario

Suppose you add this control in your page:

<asp:RequiredFieldValidator 
    ID="rfvName" 
    runat="server" 
    ControlToValidate="txtName"
    ErrorMessage="Name is required">
</asp:RequiredFieldValidator>

When you run the project, instead of loading the page, you see the error message.

🛠 Solution 1 – Quick & Easy Fix (Best for Beginners)

This solution disables unobtrusive validation.

✅ Step 1: Open Web.config

Go to:

YourProject → Web.config

✅ Step 2: Add This Code Inside <appSettings>

<appSettings>
  <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>

If <appSettings> does not exist, create it.

✅ Step 3: Save and Run

Press:

Ctrl + F5

📌 Output

❌ Before Fix

Application shows:

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'

Page does not load.

✅ After Fix

✔ Page loads successfully

✔ Validation works

✔ No error appears

🛠 Solution 2 – Professional Method (Register jQuery Properly)

If you want to keep client-side validation enabled, follow this method.

✅ Step 1: Make Sure jQuery Exists

Check inside your project:

Scripts folder

You should have:

jquery-3.7.0.min.js

If not, download it from the official jQuery website and add it to Scripts folder.

✅ Step 2: Open Global.asax.cs

Go to:

YourProject → Global.asax.cs

Inside Application_Start(), add:

protected void Application_Start(object sender, EventArgs e)
{
    ScriptManager.ScriptResourceMapping.AddDefinition("jquery",
        new ScriptResourceDefinition
        {
            Path = "~/Scripts/jquery-3.7.0.min.js",
            DebugPath = "~/Scripts/jquery-3.7.0.js"
        });
}

✅ Step 3: Save and Run

Now run the project again.

  • ✔ Error will be resolved

  • ✔ Client-side validation works

🎯 Important Notes

  • This error happens only in ASP.NET Web Forms

  • It does NOT happen in ASP.NET Core

  • Always check if jQuery exists in Scripts folder

  • The name “jquery” is case-sensitive

🏁 Conclusion

In this article, we learned:

  • ✔ What UnobtrusiveValidationMode means

  • ✔ Why the ScriptResourceMapping error occurs

  • ✔ Two simple ways to fix it

  • ✔ Step-by-step instructions for beginners

This is a common error in ASP.NET Web Forms, but now you can fix it easily in just a few minutes.

If you found this helpful, share it with other developers who may face the same issue.