Had an issue the other day where I was creating a new project (part of spring cleanup!) and adding in security like I wanted. Then this bad boy came around:
‘jquery’ is not a valid script name. The name must end in ‘.js’.
Hmmm. What causes this?
Look at Global.asax – see the BundleConfig pointer?
So, this gives us our starting place. We need to make changes to BundleConfig.cs (under App_Start) and the Site.Master page.
So for example to add a “bootstrap” name we can point to in our site master, we use the following snippet:
ScriptManager.ScriptResourceMapping.AddDefinition(“bootstrap”, new
ScriptResourceDefinition
{
Path = “/scripts/bootstrap.min.js”,
DebugPath = “/scripts/bootstrap.js”,
LoadSuccessExpression = “bootstrap”
});
Now in Site.Master the following ScriptReferences should work with no errors: