Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jon Behrens 53 posts 77 karma points
    May 04, 2011 @ 19:27
    Jon Behrens
    0

    path problem IIS7 Integrated Mode

    I have a clean install of 4.52 ASP.NET 3.5 on IIS7 in Integrated Mode. The home page cannot find the CSS files and the script files. If I type http://server/newSite, the styles and scripts don't show up. They do show up if I type http://server/newSite/ (note the trailing slash). If I go to classic app pool, either URL finds the files and the site displays properly.

    I've got umbracoUseDirectoryUrls set to true and I've added a precondition="" to the UrlRewriteModule.

    No clue where to go from here - I'd like to use Integrated Mode if possible.

    Thanks,

    Jon

  • Lennart Stoop 304 posts 842 karma points
    May 04, 2011 @ 20:25
    Lennart Stoop
    0

    Hi Jon,

    I'm not sure why but it looks like the requests are being handled by a different module.

    Does it help adding to following attribute to the modules section?

    <modules runAllManagedModulesForAllRequests="True">

     

    Grtz

  • Jon Behrens 53 posts 77 karma points
    May 04, 2011 @ 21:19
    Jon Behrens
    0

    Thanks for the reply. Unfortunately that doesn't seem to help.

  • Lennart Stoop 304 posts 842 karma points
    May 04, 2011 @ 21:33
    Lennart Stoop
    0

    That's odd.

    And if you look at the HTTP requests for the missing CSS/JS do you get 404 or 500 error messages?

    If it's a 500 you might learn more from the error message?

  • Jon Behrens 53 posts 77 karma points
    May 04, 2011 @ 21:46
    Jon Behrens
    0

    It throws a 404

  • Lennart Stoop 304 posts 842 karma points
    May 04, 2011 @ 21:49
    Lennart Stoop
    0

    Is the URL of the requests somewhat different than the working requests (when using trailing slash) ?

    How exactly are you referencing the CSS/JS files in your template ?

  • Jon Behrens 53 posts 77 karma points
    May 04, 2011 @ 21:58
    Jon Behrens
    0

    The head section of the page is as follows. As I said, in pipeline mode, the style sheets and the script files throw a 404. If the site url is trailed with a slash, the files load as expected.

     

    <head id='head' runat="server">

     

    <title>Foobar</title>

     

    <style type="text/css">

     

    @import "css/site.css";

     

    @import "css/colors.css";

     

    </style>

     

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>

     

    <script src="scripts/curvycorners.js" type="text/javascript"></script>

     

    <script src="scripts/document.js" type="text/javascript"></script>

     

    </head>

  • Lennart Stoop 304 posts 842 karma points
    May 04, 2011 @ 22:12
    Lennart Stoop
    0

    I tend to add a leading slash to the CSS/JS paths, e.g. "/scripts/curvycorners.js", does that make a difference?

  • Jon Behrens 53 posts 77 karma points
    May 04, 2011 @ 22:21
    Jon Behrens
    0

    You bet it does - then nothing works.

  • Lennart Stoop 304 posts 842 karma points
    May 04, 2011 @ 22:37
    Lennart Stoop
    0

    Well, I honestly believe the leading slashes are causing it.

    I'm not sure about those CSS import statements, but this should work:

    <head id='head' runat="server">
        <title>Foobar</title>
        <link href="/css/site.css" rel="stylesheet" media="screen" type="text/css" />
        <link href="/css/colors.css" rel="stylesheet" media="screen" type="text/css" />
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
        <script src="/scripts/curvycorners.js" type="text/javascript"></script>
        <script src="/scripts/document.js" type="text/javascript"></script>
    </head>

     

  • Jon Behrens 53 posts 77 karma points
    May 04, 2011 @ 23:31
    Jon Behrens
    0

    Thanks for all of your help. Unfortunately that doesn't work either. After some more searching around, I found an approach that does work at http://aspnetresources.com/blog/more_on_url_rebasing_in_master_pages. Here's the final version.

     

    <head id='head' runat="server">

     

    <title>Foobar</title>

     

    <style type="text/css">

     

    @import '<%= ResolveUrl("~/css/site.css") %>';

     

    @import '<%= ResolveUrl("~/css/colors.css") %>';

     

    </style>

     

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>

     

    <script src='<%=ResolveUrl("~/scripts/curvycorners.js") %>' type="text/javascript"></script>

     

    <script src='<%=ResolveUrl("~/scripts/document.js") %>' type="text/javascript"></script>

     

    </head>

Please Sign in or register to post replies

Write your reply to:

Draft