0

I have website which using Visual Studio 4 (.NET Framework 4) and bundling, and it runs locally on my machine (from Visual Studio) and also runs locally on the server just fine (using ...localhost/myWebsite/myWebPage.aspx).

But, when I access the page from the outside (..myDomain/myWebsite/myWebPage.aspx), I am getting the error

Failed to load resource: the server responded with a status of 404 (Not Found)
...//myDomain/myWebsite/bundles/jquery?v=Hd6gS6lVluRXliWH-rB-gFCWqe5KCgDBB4IJl6ONpB01

The error is on the line

 </title>
    <script src="/myWebsite/bundles/jquery?v=Hd6gS6lVluRXliWH-rB-gFCWqe5KCgDBB4IJl6ONpB01">
 </script>

In my website folder, there is no real folder whose name is "bundles".

This is in Global.asa.cs

using System.Web.Optimization;
void Application_Start(object sender, EventArgs e)
{
RegisterBundles(BundleTable.Bundles);
}
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/scripts/myJSFile.js",
"~/scripts/jquery-1.4.1-vsdoc.js",
"~/scripts/jquery-1.4.1.js"
));
}

This is in the master page

<head runat="server">
<title></title>
<%: Scripts.Render("~/bundles/jquery")%> //-->>> ERROR HERE

I downloaded the hot fix from ...support.microsoft.com/en-us/kb/980368, but when trying to install it on my Server 2008 R2 64bit, I got the error

Windows Update Standalone Installer. The update is not applicable to your computer.

Somebody mentioned that "this hot fix is rolled up in server 2008 r2 sp1", but our server 2008 R2 64 bit already has SP1.

How can I fix this error ?

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
faujong
  • 949
  • 4
  • 24
  • 40
  • Hi shruti1810 What did you mean by "Highlighted errors" ? Can anybody help me on this issue ? Thank you – faujong Jun 10 '15 at 13:36
  • The errors which you are getting should appear with a yellow background. So that it is easy for the reader to spot it easily. – shruti1810 Jun 10 '15 at 13:51
  • Oh OK. Thank you. I still can't figure out why I am getting this error "Failed to load resource: the server responded with a status of 404 (Not Found)" when accessing the page externally (https://myDomain/myWebsite/myWebPage.aspx). I don't have the problem when accessing the page on the local server machine. – faujong Jun 10 '15 at 19:01
  • On the local server machine, on the browser address bar, if I type ...://localhost/myWebsite/bundles/jquery?v=Hd6gS6lVluRXliWH-rB-gFCWqe5KCgDBB4IJl6ONpB01 the file exists. But, externally, when I type ...://myDomain/myWebsite/bundles/jquery?v=Hd6gS6lVluRXliWH-rB-gFCWqe5KCgDBB4IJl6ONpB01 it says "Not Found The requested URL /myWebsite/bundles/jquery was not found on this server. – faujong Jun 10 '15 at 19:08
  • Do you have the files on the external webserver, and is the webserver up and running? Can you try uploading a simple html file on your webserver and check if you are able to access it? (The external webserver) – shruti1810 Jun 10 '15 at 19:11
  • The file is there on the server, since on the server machine itself, when on the browser address bar I type ...://localhost/myWebsite/bundles/jquery?v=Hd6gS6lVluRXliWH-rB-gFCWqe5KCgDBB4IJl‌​6ONpB01, it asks me to download the file, and when I do that, it saved the file and I can view the JavaScript codes in the .js file. The webserver is running, because externally I can upload a simple html/aspx file, and I can type ...://myDomain/myWebsite/myWebPage.aspx and the page shows up. I only have a problem with the "bundle" files externally. – faujong Jun 10 '15 at 19:24
  • I am able to fix the problem by replacing <%: Scripts.Render("~/bundles/jquery")%> with Thank you – faujong Jun 10 '15 at 20:26
  • The only difference is when I do View Source on the page, instead of showing it shows this instead That should be fine, right ? – faujong Jun 10 '15 at 20:34

0 Answers0