WebResource and Behaviors
I'm currently developing a custom WebControl and got stuck in a problem: my carefully crafted behavior didn't work as a Embedded Resource.
Well... let's dissect this:
Well... let's dissect this:
- I created a behavior file for use with Internet Explorer (*.htc);
- Added this file as an Embeded Resource to my Assembly;
- Added the WebResource attribute to my assembly pointing to the HTC file;
- Made the reference to the HTC file using the
GetWebResourceUrl function; and - BANG! Nothing happened.
After a few tests and some poking around on the net, I finally discovered what I did wrong.
When I wrote the WebResource attribute in the AssemblyInfo file, I put "text/plain" as the MIME-type for the HTC file.
To the HTC file work correctly it requires the "text/x-component" MIME-type.
After I put the right MIME-type, the behavior worked perfectly, as it was supposed to.
0 Comments:
Post a Comment