views:

354

answers:

1

I am migrating a web part from 2003 to 2007. The web part originally used styles from a modified core style sheet. I now want to create a separate stylesheet just for this web part.

I have tried to use

CssRegistration.Register("/wpresources/Portal.Megamenu/mystyles.css");

but this results in a HTTP 401 and I have to log in (NTLM is enabled). I also have some javascript files which get successfully loaded from that same location. If I enter the url directly I get the 401 for the CSS file but not for the JS files.

Can anyone point out what I'm doing wrong?

Thanks

+1  A: 

Probably a long shot but have you checked the file permissions for mystyles.css in comparison to the JavaScript files?

Alex Angas
I wondered that but what kind of permissions might it be and why would MOSS differentiate between JS and CSS? In IIS? or filesystem?
paul
It would not, but when you copy a file from a secured location like your desktop to the wwwroot it can carry its ACL across. Just overwrite the security settings on the file and set the same rights as the js files.
ArjanP
Brilliant idea! I had copied this file over 'by hand' because I thought the deploy had a problem. I fixed the deploy problem but the file kept its' attibutes even after subsequent deploys. I deleted the CSS file and deployed again - it works!Thanks
paul