Scriptreference named response no longer works

Use: Visual Studio Express 2013 for Web to create a .NET 4.5.1 site.

Initially, the project was built on the template "Create a new site" by default, so the parts in question were added to my project using the IDE and were not edited.

It was a project for several weeks, and today I began to get an error due to the blue in relation to the "canned" items added at the time of creation. It has been working without errors so far.

Error message:

Server Error in '/' Application.  

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

I debugged this direct relation to this line in the site.master file:

<asp:ScriptReference Name="respond" />

CM. COMMENT HERE This link is in the section of my main file:                    

This is part of a much larger group of script links added by the IDE at creation time.

.js; ; .

/ :

Server Error in '/' Application.

The assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' does not contain a Web resource that
has the name 'respond.js'. Make sure that the resource name is spelled correctly.

, : .ASPX, , ... ide, . .

, . , response.js , , bootstrap.

googled , , , .

. , "temp" , , , , .

?

+4
7

Site.Master :

<asp:ScriptReference Name="respond"/>

:

<asp:ScriptReference Name="respond" Assembly="System.Web.Extensions" />
+2

, ... global.asax.cs, Routeconfig BundleConfig , .

    void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }
+2

, .

RegisterBundles BundleConfig:

ScriptManager.ScriptResourceMapping.AddDefinition(
                "respond",
                new ScriptResourceDefinition
                {
                    Path = "~/Scripts/respond.min.js",
                    DebugPath = "~/Scripts/respond.js",
                });
+1

:

  • .

  • VS, "" , " " .

+1

, Config .

. Global.asax.cs , - .

Global.asax.cs .

0

, asp.net - , Visual Studio (2015 ) Azure.

. , .

, jquery. -

, AddDefinition "reply" RegisterBundles. DLL .

            bundles.Add(new ScriptBundle("~/bundles/respond").Include(
                    "~/Scripts/respond.min.js"));

Asp: PlaceHolder site.master.

        <%: Scripts.Render("~/bundles/respond") %>

, ScriptManager site.master.

0

. ,

<add name="BundleModule" type="System.Web.Optimization.BundleModule" />

    web.config

. https://forums.asp.net/t/1857743.aspx?Bundling+not+working+when+deployed+to+web+host+works+fine+locally

0

Source: https://habr.com/ru/post/1535173/


All Articles