views:

176

answers:

3

I have this asp.NET web site that for some odd reason doesn't want to load css and script from the plugin I just wrote. This occurs if I use View in browser option in Visual studio. If I preview a sample file in browser directly from file system, it works OK.

I have checked source code of ASP site and it contains both files. In Firefox I even clicked on both hrefs and the content was displayed.

clip from code:

<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    ...
    <link rel="stylesheet" type="text/css" href="plugin/adPlayer/adPlayer.css" />
</head>
<body>
    ...
    <script type="text/javascript" src="plugin/adPlayer/adPlayer.js"></script>
</body>

Any ideas?

Edit: I am using ASP.NET development server for preview.

Edit 2: Installed IIS 5.1. Problem remains. Btw, this only occurs in Firefox browser. There is no request for those CSS and JS files in Firefox.

+2  A: 

Are you sure it's not loading it? A few ideas:

  • Clear your browser cache.

  • Look at your IIS log file to see if those files are being requested.

  • Use Fiddler or FireBug to see the HTTP requests and responses.

  • Is that the ASP source or output HTML you posted above? If it's the ASP, check the actual output HTML.

  • Check that the adplayer subdirectory on the web server is accessible to the IIS process user, anonymous user or whatever.

  • This is a long shot, but since those files should be served by IIS not ASP, check that there is nothing in your config that is forcing them into ASP, such as:

    <system.web> <httpHandlers> <add verb="*" path="*.js" type="System.Web.HttpForbiddenHandler" /> </httpHandlers> </system.web>

Rob Kent
I am using ASP.NET development server for preview. Also, I checked HTTP request headers and there is no sign of site actually requesting said CSS and JS files.The code up there is already generated code previewed via View Source in Firefox.
Vladimir Kocjancic
I've never seen this symptom but it could be related to the dev web server in some mysterious way. If you have IIS on your machine, change the project properties so that it uses IIS instead. Or do a quick test with IIS by mapping your source directory.
Rob Kent
Related question: http://stackoverflow.com/questions/1378861/asp-net-development-server-not-serving-everything-all-the-time
Rob Kent
Rob... thank you for that one. Installing IIS as I type :).Thing is, we never had a problem with ASP.NET development server in the past.
Vladimir Kocjancic
It may not solve your problem but I think it's easier to diagnose in IIS, not least because you can see the log files. It also means that you don't have to cope with different developers using different ports for their dev server instance. But that is my subjective preference only.
Rob Kent
Installed IIS. Same thing. Css doesn't get loaded however, when entering the very same URL to browser, it shows up without any issues
Vladimir Kocjancic
Hmmm... now it seems to be only Firefox issue. It works fine in IE7, Chrome, Opera and Safari
Vladimir Kocjancic
It's probably the word 'plugin' in the url :)
Rob Kent
As much fun as that would be, I already use another plugin in the same plugin directory and it works fine :D
Vladimir Kocjancic
A: 

what happens, wehn you open the css-file in you browser?

CURRENT_URL + plugin/adPlayer/adPlayer.css

is plugin perhaps in your root path? then you need to prepend a slash to your style-href

<link rel="stylesheet" type="text/css" href="/plugin/adPlayer/adPlayer.css" />
Labuschin
File is opened without any problems. I checked page info as well, thinking it could be something wrong with type, but it is text/css.And plugin is unfortunately not in root path
Vladimir Kocjancic
sorry, then i don't know
Labuschin
A: 

Problem solved. For some odd reason, the folder in which the plug-in resided wasn't viable for Firefox. I assume that this is it, as after I created a new folder, and checked out content from subversion and linked it properly, everything started to work just fine.

Vladimir Kocjancic