Some features in ASP.NET, in particular the validation and login / register user controls require jQuery to operate effectively, to do this, a Script resource defining the location of the jQuery libraries needs to be added to the project
string JQueryVer = "3.2.1";
ScriptManager.ScriptResourceMapping.AddDefinition("jquery", new ScriptResourceDefinition
{
Path = "~/Scripts/jquery-" + JQueryVer + ".min.js",
DebugPath = "~/Scripts/jquery-" + JQueryVer + ".js",
CdnPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-" + JQueryVer + ".min.js",
CdnDebugPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-" + JQueryVer + ".js",
CdnSupportsSecureConnection = true,
LoadSuccessExpression = "window.jQuery"
});
ScriptManager
is underlined in red, then, with the cursor placed in the code, press Ctrl + . (Control and full stop), and choose the 'using System.Web.Ui' optionThis can be done by opening the Nuget Package manager - click Tools -> Nuget Package Manager -> Manage Nuget Packages for Solution...
In the dialogue box that appears search for (if required) then select jQuery, and in the right hand pane select the project name check box and click install
Alternatively the jQuery library can be manually added using the instructions below: