1

I'm trying to get css3pie to work with asp.net mvc, but for some reason it's not working.

I have a view which contains inline css which looks like this:

@{
    ViewBag.Title = "Home Page";
}

<div>


    <div class="contentWrapper" style="width:600px;margin:25px auto;">
        Hello World
        <input name="button" value="Button" class="button" type="button" />
    </div>
</div>


@section BreadCrumb {
    <div class="breadcrumb">
    </div>
    <div class="pageTitle">
        <h1></h1>
    </div>
} 

@section HeaderContent {

<style type="text/css"> 

    .contentWrapper  
    {
        border: 1px solid #ddd; 
        padding: 30px 40px 20px 40px; 
        background: #fff;
        /* -- CSS3 - define rounded corners for the form -- */  
        -webkit-border-radius: 10px;
        -moz-border-radius: 10px;
        border-radius: 10px;        

        /* -- CSS3 - create a background graident -- */

        background: -webkit-gradient(linear, 0% 0%, 0% 40%, from(#EEE), to(#FFFFFF)); 
        background: -moz-linear-gradient(0% 40% 90deg,#FFF, #EEE); 
         -pie-background: linear-gradient(#FFF, #EEE); 


        -webkit-box-shadow:0px 0 50px #ccc;
        -moz-box-shadow:0px 0 50px #ccc; 
        box-shadow:0px 0 50px #ccc;     

        behavior: url(PIE.htc);
    }   


    </style> 

}

I've tried placing the PIE.htc file in the root directory of my project, the views directory, and many other places but it doesn't look like it's working in IE8 and below. Where exactly should the htc file go and how am i to reference it correctly through both inline css and and external stylesheet?

Thanks

zSynopsis
  • 4,854
  • 21
  • 69
  • 106
  • Did you confirm that the file was downloaded by the browser, either by using the web development console, or by fiddler? – Tomas Aug 05 '11 at 16:12
  • Yes it looks like it is downloading it, but is the content-type supposed to be text/x-component? – zSynopsis Aug 05 '11 at 16:30

1 Answers1

5

I got it. Add it to the Content folder with your CSS file then for the behavior in the CSS file do:

behavior: url('../../Content/PIE.htc');

It worked for me anyway.

MRR0GERS
  • 652
  • 5
  • 18