![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Using htc file in assemble include resource I am developing the web controls and try to include all client files: scripts, styles, etc in an assembly as resource common way like: [assembly: System.Web.UI.WebResource("TLF.behaviour.htc", "text/javascript")], and use ClientScriptManager class. I have faced a problem with htc files, I get url following way: class MyControl:WebControl { string GetUlr() { return this.Page. ClientScript. GetWebResourceUrl(this.GetType(),”TLF.behaviour.htc”); } } The method returns some like “WebResource.axd?d=sVNSkov2zl0&t=633439341206302606” correctly. But in run time no behavoior has been load – seems IE needs “.htc” file extantion to attach behavoior. ? Any suggestions? Thanks |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Using htc file in assemble include resource "Pab" <Pab@xxxxxx> wrote in message news:9B13ECDD-3B3B-4583-BC1C-D69F79183782@xxxxxx Quote: > I am developing the web controls and try to include all client files: > scripts, styles, etc in an assembly as resource common way like: > [assembly: System.Web.UI.WebResource("TLF.behaviour.htc", > "text/javascript")], and use ClientScriptManager class. > > I have faced a problem with htc files, I get url following way: > > class MyControl:WebControl > { > string GetUlr() > { > return this.Page. ClientScript. > GetWebResourceUrl(this.GetType(),"TLF.behaviour.htc"); > } > } > The method returns some like > "WebResource.axd?d=sVNSkov2zl0&t=633439341206302606" correctly. > > But in run time no behavoior has been load - seems IE needs ".htc" file > extantion to attach behavoior. ? > text/javascript. If that doesn't work then you might be right about it needing HTC extension. behaviours in IE are an old technology. Personally I would avoid them. .NET gives you alternatives for example if you are adding a behaviour to an INPUT you can inherit the server side representation and include some code to hook up the events you need and inject what Javascript is needed. -- Anthony Jones - MVP ASP/ASP.NET |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Using htc file in assemble include resource Using text/x-component instead of text/javascript decided a point. Great! Thanks! "Anthony Jones" wrote: Quote: > "Pab" <Pab@xxxxxx> wrote in message > news:9B13ECDD-3B3B-4583-BC1C-D69F79183782@xxxxxx Quote: > > I am developing the web controls and try to include all client files: > > scripts, styles, etc in an assembly as resource common way like: > > [assembly: System.Web.UI.WebResource("TLF.behaviour.htc", > > "text/javascript")], and use ClientScriptManager class. > > > > I have faced a problem with htc files, I get url following way: > > > > class MyControl:WebControl > > { > > string GetUlr() > > { > > return this.Page. ClientScript. > > GetWebResourceUrl(this.GetType(),"TLF.behaviour.htc"); > > } > > } > > The method returns some like > > "WebResource.axd?d=sVNSkov2zl0&t=633439341206302606" correctly. > > > > But in run time no behavoior has been load - seems IE needs ".htc" file > > extantion to attach behavoior. ? > > > A HTC is not Javascript, try using text/x-component instead of > text/javascript. > > If that doesn't work then you might be right about it needing HTC extension. > behaviours in IE are an old technology. > > Personally I would avoid them. .NET gives you alternatives for example if > you are adding a behaviour to an INPUT you can inherit the server side > representation and include some code to hook up the events you need and > inject what Javascript is needed. > > > -- > Anthony Jones - MVP ASP/ASP.NET > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| include file name in output | PowerShell | |||
| Backup: How to include JSP file type | Vista account administration | |||
| Is there a way to get a file resource in PowerShelll? | PowerShell | |||
| Include shared folder/file in "save" file list | Vista General | |||