2

I created another folder for my pie.htc..but when I load my html file in IE8 it does not work..i already tried setting different location to its behavior but still it wont work..

here's my code..

behavior: url(/pie/PIE.htc);
cfz
  • 343
  • 3
  • 7
  • 19

3 Answers3

2

As others have noted elsewhere, and as documented here http://css3pie.com/documentation/known-issues/, the PIE.htc file location must be relative to the page where it's used, not relative to the css file. If you'll need to use PIE from within several different pages, consider adding a reference to it dynamically.

Here's how we handled it in a C# .Net application with a master page:

In the master page's markup between the head tags, place the following line:

<style id="InlinePageStyles" runat="server" type="text/css"></style>

In the Page_Load method of the master page's code behind, place the following line:

//get path to PIE.htc and add it to the page as a style (creates a class called Pie)
InlinePageStyles.InnerHtml += string.Format(".Pie {{ behavior: url({0}PIE.htc); }}", ConvertRelativeUrlToAbsoluteUrl(this.Request, ResolveUrl("~/")));

Also in the code behind, add this method:

private string ConvertRelativeUrlToAbsoluteUrl(HttpRequest request, string relativeUrl)
{
    return string.Format("http{2}://{0}{1}", request.Url.Host, System.Web.VirtualPathUtility.ToAbsolute(relativeUrl), request.IsSecureConnection ? "s" : string.Empty);
}

Next, remove the behavior from your CSS.

Finally, add the "Pie" class to any page elements that need it.

Hope this helps.

Cactus Bob
  • 53
  • 5
1

behavior: url(../pie/PIE.htc);

".." for folder selection and pie is the folder

Sumit Sharma
  • 1,847
  • 1
  • 22
  • 25
0

...............................

HI now put your pie.htc in root location and

write to css as like this

behavior: url(PIE.htc);

more info

Shailender Arora
  • 7,674
  • 2
  • 31
  • 35
Rohit Azad Malik
  • 31,410
  • 17
  • 69
  • 97
  • i already did that but still it won't work..i also tried putting the full location like this behavior: url(//localhost/ptt/ptt.html/PIE.htc); but nothing happened also..=( – cfz Oct 08 '12 at 04:50
  • i tried putting the PIE.htc file to the same root folder with my html file and it worked..the problem now started when I put the .htc file to its own folder like what I did with my css and javascript files. – cfz Oct 08 '12 at 04:56