My ASP.Net project is working well, when suddenly we had a power failure. When I ran my web app, it is now showing a lot of
Could not load assembly Sanitizer..." then "Could not load "HtmlAgility...
errors. I was able to resolve these previous errors by uninstalling / reinstalling them using Manage Nuget Package Solutions inside Visual Studio 2012.
But now I encountered another error:
'jquery' is not a valid script name. The name must end in '.js'."
I tried to do same thing by re-installing the package but it does not work. What should I do to resolve this? I already have a jquery.js file located on my root\Scripts folder. I also added reference to this file inside my section:
<script src="Scripts/jquery.js"></script>
But still it won't work. Please help.
By the way guys, I was able to resolve this by installing the AspNet.ScriptManager.jQuery.UI.Combined
and AspNet.ScriptManager.jQuery
packages using the Nuget tool.
Right click on your project and go to manage NuGet packages and then just install
AspNet.ScriptManager.jQuery.UI.Combined
and
AspNet.ScriptManager.jQuery
packages
Here is working solution
Open
Global.asax
in your solution
Copy below code just modify your Jquery Version accordingly and paste it inside Application_Start event of Global.asax
ScriptManager.ScriptResourceMapping.AddDefinition("jquery", new ScriptResourceDefinition
{
Path = "~/Scripts/jquery-1.10.2.min.js",
DebugPath = "~/Scripts/jquery-1.10.2.js",
CdnPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.2.min.js",
CdnDebugPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.2.js",
CdnSupportsSecureConnection = true,
LoadSuccessExpression = "window.jQuery"
});
ScriptManager.ScriptResourceMapping.AddDefinition("jquery.ui.combined", new ScriptResourceDefinition
{
Path = "~/Scripts/jquery-ui-1.10.2.min.js",
DebugPath = "~/Scripts/jquery-ui-1.10.2.js",
CdnPath = "http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.2/jquery-ui.min.js",
CdnDebugPath = "http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.2/jquery-ui.js",
CdnSupportsSecureConnection = true
});
ScriptManager.ScriptResourceMapping.AddDefinition("bootstrap", new ScriptResourceDefinition
{
Path = "~/Scripts/bootstrap.min.js",
DebugPath = "~/Scripts/bootstrap.js",
CdnPath = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js",
CdnDebugPath = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js",
CdnSupportsSecureConnection = true
});
In my case, I had to add the two dlls as reference to my project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With