[RESOLVED]Jquery in Scriptmanager

Visual Studio put this in for me:
 <asp:ScriptManager runat="server">
                <asp:ScriptReference Name="jquery" />
How does Asp.Net know which version if Jquery to pick? Where is it loaded from?
What am I missing?

You likely already have a particular reference to it defined and it included within your current project or solution (you might check a Scripts folder if one is present). You can also check either the Global.asax file if one is present or the BundleConfig.cs
file within the App_Start folder and you should see a mapping that looks something like this :

ScriptManager.ScriptResourceMapping.AddDefinition("jquery", new ScriptResourceDefinition
        // Code omitted for brevity

Within this, you’ll see a bit of code that should specify your jQuery location.

Your code make sense but does not exist in my project.

I found this line in Package.config:

<package id="AspNet.ScriptManager.jQuery" version="1.10.2" targetFramework="net45" />

(that is convoluted)

The Package.config file generally indicates that you are using NuGet to load packages for your project. In this case, a particular package called
AspNet.ScriptManager.jQuery, which as mentioned here will do the following:

"This package contains the AspNet.ScriptManager.jQuery assembly that will automatically register jQuery 1.10.2 with the ScriptManager as "jquery".

You should have some code after installing this package that explicitly demonstrates this occurring (try searching your project and it’s code files for "jquery") if you cannot find any that look like your ScriptManager pointing to a particular file,
then it’s likely just being handled from a reference within the package itself.

Leave a Reply