Strange behavior with IE or .Net ?

I found a strange thing happening this morning on the relationship between external stylesheets and aspx pages.
I am not sure how this thing occured but if I use a link using a slash at the end, no style sheet is apply at all:

http://www.scoilnet.ie/scoilnet/Default.aspx/

Note the slash at the end. Try it to see by yourself !

UPDATE: Well I am not sure this is not a bug from Internet Explorer after all. Don't have a chance to have Firebird install on this machine so if somebody want to try.

I test it with different .Net sites, same effect !

SECOND UPDATE: Yes readers report that this happen too with Firebird.

 I would like to see a 404 HTML page not found type of message happening if I use the / at the end. After all it's not the correct URL.
So with a 404 error I can redirect to a proper error page, and eventually detect the problem from my stats package. Here no hope because the page load of course screwed by the lack of CSS !

It seems that it's really only with .aspx extension. With .asp and .html or .htm yes I have a 404 error !
Vazz report one .html case where the same problem happen.

So unless somebody has an easy answer, do you think we should escalate this as a bug ?

THIRD UPDATE: OK now it seems that indeed this is more about not loading at all the <head>...</head> section of the page.
So the result is that now this stupid thing screw the javascript the images, the stylesheets, but it still display the page !

 

18 Comments

  • At both I get an exception! :)

  • Oopps ! Sorry the link is wrong ;-)

  • you are totally right.



    i get that with hotmail sometimes, and even www.asp.net sometimes.

  • Yup, Firebird 0.7 also shows this...

  • Might just be a HTML feature, try out:

    <a target="_new" href="http://edocs.bea.com/wlp/docs81/relnotes/relnotes.html/">http://edocs.bea.com/wlp/docs81/relnotes/relnotes.html/ and http://edocs.bea.com/wlp/docs81/relnotes/relnotes.html

    They have the same thing happening with them.

  • I'd guess it's due to the relative URL being used by the browser to access the stylesheets...probably just looks for the last / and uses that as the base href...

  • So guys can we call this a BUG ?

    I test on different sites (not only mine) and the same happens !

  • Same thing on an apache websites happens, so its probably a html thing.

  • Anyway it's a **great** idea for all the web scrappers who wants to get some content without the hassle of the styles !

    More positive idea this can be a cool trick for an easy accessible text only version !

    I have another site(not public yet unfortunatly) where the pages are 100% done with CSS. Amazing result, look like back to the good old times of Mosaic ;-))

  • Barfield you sure about this on apache? Because I talk about .aspx there so unless you have mono ? By the way if you had a / behind a .html file Apache or IIS look behind for another folder or another page.

    I would rather like to see the same effect with .aspx having my page displayd badly like this

  • Vazz agree with you but the problem for me is more the CSS external files which not appear to load at all !

  • As I said guys I would like to see a 404 HTML page not found type of message happening if I use the / at the end. After all it's not the correct URL.

    So with a 404 error I can redirect to a proper error page, and eventually detect the problem from my stats package. Here no hope because the page load of course screwed by the lack of CSS !

  • Thanks Dennis for this but here it's not really the issue. All the &lt;head&gt; section disappears ! And this happens too to very big other .Net sites.

  • So the question is: why this behavor doesn't happen with other extensions, like .htm .asp, .jsp, .php, etc... ?!??

  • It could be interesting to see how Netscape 4 or IE3/4 act with this

  • So Tom ok wih that but why this doesn't happens with .asp pages ? or .htm ?



    On .asp page if you add the / you have an error type 404, which is fully understandable and right for me.



    But I don't like the idea that the .aspx page is rendered without the css or the javascript.

    And this happen to Microsoft pages too ! Amazing no ;-))

  • The &quot;aspx&quot; engine interprets &quot;everything after the slash&quot; as &quot;parameters to pass to the page&quot;. Your page needs to be prepared for that case. The easiest way is to stick a &lt;BASE HREF=&gt; at the top of the page giving the &quot;canonical&quot; name of the page. Then all relative paths will resolve relative to the name you give in the &lt;BASE&gt; rather than to the &quot;actual&quot; name.



    The browsers are doing the right thing. The rule for relative paths is &quot;take the name of the page, remove everything after the last slash, then append the relative path&quot;.

  • Raymond is right on the topic. Now, this does not happen with ASP, since the ASP ISAPI DLL does not do this kind of thing. Same for HTML, except that the ASP ISAPI DLL is not called for this but that it's handled by IIS itself (in a standard environment).



    Now, how can you resolve this? The ASP.NET ISAPI is configured not to check if the file exists. Go to the application settings of your webapp (on the virtual folder in the IIS MMC, click properties, click configuration on the default tab). There you'll find a tab &quot;Mappings&quot; and a list of all extentions and the ISAPI that handles them. For security reasons the list should be as short as possible (read: needed), but this is another topic. Now, find the &quot;.aspx&quot; extention and click &quot;Edit&quot;. Now you can check the checkbox &quot;Check if file exists&quot;. If you do this, IIS will check if a file actually exists before it sends the request to the ISAPI handler. So, in this case, IIS will check if your &quot;page.aspx/&quot; exists. Since it doesn't, you will get a 404. Please note that this can have an impact if you want to work with &quot;virtual files&quot;, i.e. requests to files that do not really exist but that are handled correctly by a HTTP Handler.

Comments have been disabled for this content.