📌 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:

In this article, we will understand:

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:

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.

🎯 Important Notes

🏁 Conclusion

In this article, we learned:

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.