I have a link in my _Layout.cshtml that isn't loading for some reason.
<linkhref="@Url.Content(
"~/Content/Site.css"
)"rel="stylesheet"type="text/css"/>
In
Fiddler2 I see that I'm getting a 302 code for this Site.css file and when I inspect what is coming back from the server, I see:
I figured out part of the problem, I was using IIS 7 when the .css files weren't loading, I switched back to the development web server and the .css files and images are now loading, but the JavaScript files are still showing up as Not Found (otherwise known
as Html Error code 404).
Switching over from the development web server to the IIS 7 web server was the start of my issues here, but switching back to the development web sever is still blocking the JavaScript files from loading and I don;t yet understand why!
eric2820
Contributor
2777 Points
1161 Posts
Site.css shows a 302 HtmlErrorCode
Dec 22, 2012 12:41 AM|LINK
I have a link in my _Layout.cshtml that isn't loading for some reason.
<link href="@Url.Content( "~/Content/Site.css" )" rel="stylesheet" type="text/css" />
In Fiddler2 I see that I'm getting a 302 code for this Site.css file and when I inspect what is coming back from the server, I see:
<h2>Object moved to <a href="/My-MSI.Net/Account/Login?ReturnUrl=%2fMy-MSI.Net%2fContent%2fSite.css">here</a>.</h2>
What is going wrong here?
How can I change things to get this accepted?
http://www.my-msi.net/Admin
blog
If a post helps you, please mark it as Ansered, thank-you.
bruce (sqlwo...
All-Star
36852 Points
5446 Posts
Re: Site.css shows a 302 HtmlErrorCode
Dec 22, 2012 12:54 AM|LINK
eric2820
Contributor
2777 Points
1161 Posts
Re: Site.css shows a 302 HtmlErrorCode
Dec 22, 2012 12:58 AM|LINK
IIS_IUSERS have Read & Execute, Read, and List folder contents privleges.
What other user type should I be allowing?
http://www.my-msi.net/Admin
blog
If a post helps you, please mark it as Ansered, thank-you.
eric2820
Contributor
2777 Points
1161 Posts
Re: Site.css shows a 302 HtmlErrorCode
Dec 24, 2012 07:17 PM|LINK
I figured out part of the problem, I was using IIS 7 when the .css files weren't loading, I switched back to the development web server and the .css files and images are now loading, but the JavaScript files are still showing up as Not Found (otherwise known as Html Error code 404).
The path to the scipts is:
/Scripts/jquery-1.5.1.js
/Scripts/jquery-unobtrusive-ajax.js
/Scripts/jquery-validate.js
/Scirpts/jquery-validate-unobtrusive.js
If the Content folder is now loading, can somebody explain why the Scripts folder isn't accessable now?
http://www.my-msi.net/Admin
blog
If a post helps you, please mark it as Ansered, thank-you.
ignatandrei
All-Star
135047 Points
21654 Posts
Moderator
MVP
Re: Site.css shows a 302 HtmlErrorCode
Dec 24, 2012 07:28 PM|LINK
eric2820
Contributor
2777 Points
1161 Posts
Re: Site.css shows a 302 HtmlErrorCode
Dec 24, 2012 07:31 PM|LINK
Switching over from the development web server to the IIS 7 web server was the start of my issues here, but switching back to the development web sever is still blocking the JavaScript files from loading and I don;t yet understand why!
http://www.my-msi.net/Admin
blog
If a post helps you, please mark it as Ansered, thank-you.
eric2820
Contributor
2777 Points
1161 Posts
Re: Site.css shows a 302 HtmlErrorCode
Dec 27, 2012 12:11 AM|LINK
Actually the Scripts folder is not the problem because the Custom.js file is returning a 200 HTML Code.
But the other 4 java scripts are returning a 404 (Not Found) HTML Code.
http://www.my-msi.net/Admin
blog
If a post helps you, please mark it as Ansered, thank-you.
ignatandrei
All-Star
135047 Points
21654 Posts
Moderator
MVP
Re: Site.css shows a 302 HtmlErrorCode
Dec 27, 2012 03:41 AM|LINK
1. Please show code in page for the custom.js and one of other 404
2. please check permissions.
eric2820
Contributor
2777 Points
1161 Posts
Re: Site.css shows a 302 HtmlErrorCode
Dec 27, 2012 01:57 PM|LINK
I'm finding this for the the JavaScript files that are returning 404:
[HttpException]:
A public action method 'jquery-validate-vsdoc.js' was not found on controller 'My_MSI.Net.Controllers.ScriptsController'.
at System.Web.Mvc.Controller.HandleUnknownAction(String actionName)
at System.Web.Mvc.Controller.ExecuteCore()
at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.<BeginProcessRequest>b__5()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.MvcHandler.<>c__DisplayClasse.<EndProcessRequest>b__d()
at System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f)
at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action)
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->
How to get around this issue???
http://www.my-msi.net/Admin
blog
If a post helps you, please mark it as Ansered, thank-you.
ignatandrei
All-Star
135047 Points
21654 Posts
Moderator
MVP
Re: Site.css shows a 302 HtmlErrorCode
Dec 27, 2012 02:00 PM|LINK
Do you have BOTH a scripts folder and a ScriptsController?! Rename one ...