• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 610
  • Last Modified:

CSS Behavior file gives access is denied when document has a base href

I want to add a behavior to my style sheet:

BODY
{
      behavior: url("mybehavior.htc");
}

This works fine until I add a base href to the document.

After this I always get an "access is denied" message trying to open the behavior file.

Why am I getting this message and how can I avoid it?

I'm running IIS and IE 6.
0
purplesoup
Asked:
purplesoup
1 Solution
 
GwynforWebCommented:
take out the quotes

BODY
{
     behavior: url(mybehavior.htc);
}
0
 
GwynforWebCommented:
thinking again I doubt that is it.
0
 
German_RummCommented:
Hi purplesoup,

Access is usually denied when you are trying access behavior's from different host.
www.site.com and site.com are considered to be different hosts.
Can you paste a source code of the page, on which you are trying to attach behavior?

---
German Rumm.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
BatalfCommented:
Where is the mybehavior.htc file?

When you change the base, IE will search for the file on the domain specified by the <base> tag.

Try to put in an absolute url in the CSS

i.e.

BODY
{
     behavior: url("http://www.myDomain.com/mybehavior.htc");
}

0
 
infoseeker99Commented:
Also double check the permissioning on the directory the file is in, the file itself and the directory above that IUSER_*  has read permissions for these items.
0
 
purplesoupAuthor Commented:
It looks like it was because the named URL was different - I am running it on my local machine and the page url was

http://machinename/folder/page.html

whereas when I tried to put the full url in the behavior it was

http://localhost/folder/filename.htc

By entering "http://machinename/folder/filename.htc" or even "./folder/filename.htc" it works ok
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now