'jquery' is not a valid script name. The name must end in '.js'

前端 未结 10 1634
长发绾君心
长发绾君心 2020-12-10 11:56

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 S

相关标签:
10条回答
  • 2020-12-10 12:19

    Thanks for posting your follow-up answer. I got this same error after installing jQuery.UI to a new ASP.NET web forms project based on the new One ASP.NET template in VS.NET 2013 and adding this line to the script manager in the master page:

    <asp:ScriptReference Name="jquery.ui.combined" />
    

    After installing the AspNet.ScriptManager.jQuery.UI.Combined NuGet package as you stated, the error was immediately resolved.

    0 讨论(0)
  • 2020-12-10 12:23

    Add this to your Web.config and the issue will be resolved:

    <appSettings>
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
    </appSettings>
    
    0 讨论(0)
  • 2020-12-10 12:26

    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.

    0 讨论(0)
  • 2020-12-10 12:27

    In my case, I had to add the two dlls as reference to my project.

    0 讨论(0)
  • 2020-12-10 12:29

    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

    0 讨论(0)
  • 2020-12-10 12:29

    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
        });
    
    0 讨论(0)
提交回复
热议问题