Copied to clipboard

Flag this post as spam?

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


  • Ioannis Gkoutsidis 16 posts 67 karma points
    Jun 15, 2012 @ 22:31
    Ioannis Gkoutsidis
    0

    URLRewriting.net and ClientDependency in IIS7

    Hi all,

    I'm currently working on a page with a razor script file which does 2 jobs:

    1) If there is an albumID variable in my query string, I get the photos contained in it and

    2) If there is no query string, I get the various published albums.

    My page uses the ClientDependency Framework in order to load my CSS & JavaScript files and URLRewriting.net for converting the query string from http://www.example.com/portfolio?albumID=123 to http://www.example.com/portfolio/album/123. Furthermore, I have the Umbraco's Frirendly-URLs (Extensionless) feature set to on.

    The page's workflow is as follows: The visitor firstly hits the albums page where she can get all the available albums and when she clicks on an album's cover photo, she can get the photos in it (like Facebook).

    I am currently working on 2 different testing environments: One with WebMatrix and one with IIS7.

    And now the problem: Testing my site on IIS7, I get the albums correctly but when I select a specific album, in order to get the photos contained in it, I see a page without any CSS or JavaScript loaded (the real content is loaded correctly) and I get 2 warnings and an error in my browser's console:

    Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://anyprint.local/portfolio/album/DependencyHandler.axd?s=L2Nzcy9qcXVlcnktdWktMS44LjE4LmN1c3RvbS5jc3M7L2Nzcy9mYW5jeWJveC5jc3M7L2Nzcy9uaXZvLXNsaWRlci5jc3M7L2Nzcy9UaW55TUNFLmNzczsvY3NzL3NpdGUuY3NzOw%3d%3d&t=Css&cdv=2".
    Resource interpreted as Script but transferred with MIME type text/html: "http://anyprint.local/portfolio/album/DependencyHandler.axd?s=L3NjcmlwdHMvanF1ZXJ5LXVpLTEuOC4xOC5jdXN0b20ubWluLmpzOy9zY3JpcHRzL2ZhbmN5Ym94Lm1pbi5qczsvc2NyaXB0cy9qZmxvdy5qczsvc2NyaXB0cy9qZmxvdy1vcHRpb25zLmpzOy9zY3JpcHRzL25pdm8tc2xpZGVyLm1pbi5qczsvc2NyaXB0cy9wcmVsb2FkZXIuanM7L3NjcmlwdHMvanF1ZXJ5LWVhc2luZy5taW4uanM7L3NjcmlwdHMvbGF6eWxvYWQubWluLmpzOy9zY3JpcHRzL3RhYmJ6LmpzOy9zY3JpcHRzL3NpdGUuanM7&t=Javascript&cdv=2"
    Uncaught SyntaxError: Unexpected token <

    The strange things follows:

    1. When I test my site with WebMatrix, everything works just as expected...

    2. Using IIS7, if I change the site's debug mode to true, everything works fine and

    3. If, working again in IIS7, with the debug mode set to false and using the un-URLRewriting url (http://www.example.com/portfolio?albumID=123), everything seems to be OK as well...

    I just can't make this work in IIS7 with debug mode set to false and the URLRewriting.net url.

    I have already made some changes in my web.config file and/or IIS settings, according to some advices from google searches, but nothing seems to solve my problem...

    Any suggestions?

    Thanks in advance,

    John

     

  • Ioannis Gkoutsidis 16 posts 67 karma points
    Jun 17, 2012 @ 20:15
    Ioannis Gkoutsidis
    0

    Nevermind guys, I finally managed to get this working... All I needed to do was to create a "NoRewrite" rule for the DependencyHandler.axd as the first rule in the UrlRewriting.config file...

Please Sign in or register to post replies

Write your reply to:

Draft