Answered by:
bootstrap' is not a valid script name. The name must end in '.js'.

Question
-
User-605499000 posted
I am trying to reload certain files onto my web. Sitemaster is one of them. I am getting the above error. If I put the js at the end of bootstrap in script reference then I get another server error. It says that 4.0 is not valid and I am not using 4.0. I upgraded to 4.3.1. Can I take out the script bootstrap and still have the bootstrap js files open>
How do I get around this?
Thanks Jen
Below is the error
Server Error in '/' Application.
'bootstrap' is not a valid script name. The name must end in '.js'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: 'bootstrap' is not a valid script name. The name must end in '.js'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: 'bootstrap' is not a valid script name. The name must end in '.js'.] System.Web.UI.ScriptReference.GetDebugName(String releaseName) +139 System.Web.UI.ScriptReference.ShouldUseDebugScript(String releaseName, Assembly assembly, Boolean isDebuggingEnabled, Assembly currentAjaxAssembly) +31 System.Web.UI.ScriptReference.DetermineResourceNameAndAssembly(ScriptManager scriptManager, Boolean isDebuggingEnabled, String& resourceName, Assembly& assembly) +98 System.Web.UI.ScriptReference.GetUrlFromName(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip, Boolean useCdnPath) +103 System.Web.UI.ScriptReference.GetUrlInternal(ScriptManager scriptManager, Boolean zip, Boolean useCdnPath) +603 System.Web.UI.ScriptReference.GetUrl(ScriptManager scriptManager, Boolean zip) +182 System.Web.UI.ScriptManager.RegisterUniqueScripts(List`1 uniqueScripts) +204 System.Web.UI.ScriptManager.RegisterScripts() +465 System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +124 System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +9883610 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1069
Wednesday, July 31, 2019 5:04 PM
Answers
-
User-605499000 posted
I have just deleted the project and restarted a new project and bootstrap is working without problems. I discovered that it was not listed in the reference area and I could not get it in there. I think that when I reloaded it something went wrong and it did not load properly.
I want to thank you so much for your help and sorry again that I did not explain myself well enough. I am a self taught programmer trying to redo a site that was built in 2009. Many changes and a big learning curve. Thank goodness the project is almost done and I can get it back on my web site.
Again thanks for everything. Your forums have saved me. I will mark it as resolved.
Jen
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, August 4, 2019 2:45 AM
All replies
-
User409696431 posted
bootstrap.js must be the name.
Changing that is trying to fix your carburetor by changing your tire.
You need to fix the other error, which you haven't shown us the details for.
Thursday, August 1, 2019 2:09 AM -
User288213138 posted
Hi bumples18,
Please check your packages.config file, you can see the version you are currently using.
And you can try to add Bootstrap CDN to your page. Add below code to your <head> tag, then you could use bootstrap.
The code:
Css: <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" /> Js: <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
Best regards,
sam
Thursday, August 1, 2019 2:46 AM -
User-605499000 posted
Hi,
Thanks I have tried to get it going today and tried your files but need to use the script manager. I put in bootstrap.js and now I am getting the other error. which I will show you below. The packages and bundles all say 4.3.1 and also the styles has it listed as 4.3.1 I was using 4.0 but upgraded using nu-get. I am also included the beginning of the site.master. I am using bootstrap for the menu.
Hope you can help me, I have looked on the web for the answer.
The assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not contain a Web resource that has the name 'bootstrap.js'. Make sure that the resource name is spelled correctly.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not contain a Web resource that has the name 'bootstrap.js'. Make sure that the resource name is spelled correctly.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
here is the start of the site.master The content file is the file that has the bootstrap css files
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Jen19.SiteMaster" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%: Page.Title %> - Jen19</title><meta name="author" content="bumples.com" />
<meta name="copyright" content="copyright@2005-2016 www.bumples.com" />
<meta name="keywords" content="Interactive Story, Online Magazine For Children| Bumples "/>
<meta name="description" content="Offering both safe online magazines as well as children’s games, rest assured that your little one will be both entertained and educated." />
<meta name="robots" content="all" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="google-site-verification" content="hz1IHrDTh9VRVRFnO3KJRJNRUYV6MPQsEqElUFTpdMU" />
<meta name="msvalidate.01" content="6B1A8B0C20B99EB0148411F9E88B0B17" />
<webopt:bundlereference runat="server" path="~/Content.css" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="Css/CloudsStyleSheet.css" /><asp:ContentPlaceHolder id="HeadPlaceHolder" runat="server" />
</head>
<body>
<form runat="server">
<a id="top"></a>
<asp:ScriptManager runat="server" EnableCdn="True">
<Scripts>
<%--To learn more about bundling scripts in ScriptManager see https://go.microsoft.com/fwlink/?LinkID=301884 --%>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="bootstrap.js" />***here is the bootstrap. I tried putting in 4.3.1 here but no
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site Scripts--%>
</Scripts>
</asp:ScriptManager>Thursday, August 1, 2019 9:16 PM -
User-605499000 posted
hi again. I just opened up a new site and updated the bootstrap with no problems when I ran it. I put in the menu that I was going to use. Could the problem be with my web server. I had major problems with them downloading my site a couple of months ago and it was just a basic site. I am using network solutions which I have used for years.
Just a thought, again thanks
Thursday, August 1, 2019 9:39 PM -
User409696431 posted
ScriptReference with just a Name has to have that name defined elsewhere (and the name could be just bootstrap, if you wanted it to be).
See for example: https://devblogs.microsoft.com/aspnet/asp-net-4-5-scriptmanager-improvements-in-webforms/ You'll see the examples show how MsAjaxBundle and jquery are defined.
If bootstrap is not similarly defined, follow those examples.
Thursday, August 1, 2019 11:37 PM -
User-605499000 posted
Hi,
I thought I had it and no error and then it is back today. So nothing solved and very frustrated. I studied what you said and made sure that bootstrap had the same info as J.Query.
Below is part of the properties package
<package id="AspNet.ScriptManager.jQuery" version="3.4.1" targetFramework="net461" />
<package id="AspNet.ScriptManager.bootstrap" version="4.3.1" targetFramework="net461" /> * I added this line since jQuery had it.
<package id="bootstrap" version="4.3.1" targetFramework="net461" />
<package id="EntityFramework" version="6.3.0-preview7-19363-02" targetFramework="net461" />
<package id="EntityFramework.SqlServerCompact" version="6.2.0" targetFramework="net461" />
<package id="jQuery" version="3.4.1" targetFramework="net461" />On my site master I put back bootstrap without the js. The error today is the lack of js..
Any more ideas? Thanks Jen
Saturday, August 3, 2019 3:44 PM -
User409696431 posted
It's rather confusing to try and help you. You posted your ScriptReference lines, and I gave you a link to show you what was needed for bootstrap to be recognized that way, but now you are posting package Id information.
There is no way to know what you tried and what your current error is.
Saturday, August 3, 2019 8:18 PM -
User-605499000 posted
When I put in Js in the script I get the first error that I got. I am sorry about the confusion. I did read what you sent and I checked everywhere on my site to see if Bootstrap was listed the same as jQuery. That is why I sent you the properties. I have other websites and no problems with bootstrap. There has got to be another reason why the errors. Also the fact that it worked yesterday after reloading it but then today no. I think that I am going to have to move all my files into a new project that has a working bootstrap. I don't know what else to do.
Thank you for your help.
Jen
Sunday, August 4, 2019 12:31 AM -
User-605499000 posted
I have just deleted the project and restarted a new project and bootstrap is working without problems. I discovered that it was not listed in the reference area and I could not get it in there. I think that when I reloaded it something went wrong and it did not load properly.
I want to thank you so much for your help and sorry again that I did not explain myself well enough. I am a self taught programmer trying to redo a site that was built in 2009. Many changes and a big learning curve. Thank goodness the project is almost done and I can get it back on my web site.
Again thanks for everything. Your forums have saved me. I will mark it as resolved.
Jen
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, August 4, 2019 2:45 AM