DHTML Behaviors (HTC) in a custom server control

Discussion in 'ASP .Net Building Controls' started by JV, Mar 25, 2005.

  1. JV

    JV Guest

    I've coded a datagrid-derived control that makes use of a DHTML behavior in
    a separate script file (.htc). Now that it works, I've realized that I
    don't know how to deploy this well. I know how to embed the script in the
    project as a resource, read it back and write it to a file, but obviously
    the process under which this code would normally execute will not have the
    right to do file I/O by default.

    In all other controls I've coded, I just emitted embedded the script into
    the page. Is there any way to do something like this with my HTC file or do
    I have to start over and convert this behavior to a set of scripts?
     
    JV, Mar 25, 2005
    #1
    1. Advertising

  2. JV

    Guest

    Re: DHTML Behaviors (HTC) in a custom server control

    You could possibly read it from the assembly as a resource and store it
    in the cache. You could then setup a UrlRewrite for /Resources and have
    it spit out the htc as a script from the cache. Of course realizing
    that it would also have to handle the item not being in cache and thus
    loading it.
     
    , Mar 30, 2005
    #2
    1. Advertising

  3. JV

    JV Guest

    Re: DHTML Behaviors (HTC) in a custom server control

    I've done something like that. I have implemented a custom HTTP handler to
    respond to requests for HTC files and it spits them out from resource. The
    problem is that you have to reconfigure IIS to support the HTC extension for
    your application, and you have to modify your web.config. I can't expect
    users of my controls to jump through those kind of hoops. It should be IJW
    (it just works!) so they can just drop it on a form and start using it.

    I've also tried streaming the scripts out to the web application folder at
    design time, but in my control's OnInit function, I can't seem to do a
    MapPathSecure() call to figure out where they need to be written. I can't
    even use the path of the currently executing assembly because it's some
    visual studio cache folder at design time.

    Basically, there seems to be no solution that is of practical value....the
    solution is apparently to wait for Whidbey to be released. Unless someone
    has a more clever idea.



    "" <> wrote
    > You could possibly read it from the assembly as a resource and store it
    > in the cache. You could then setup a UrlRewrite for /Resources and have
    > it spit out the htc as a script from the cache. Of course realizing
    > that it would also have to handle the item not being in cache and thus
    > loading it.
    >
     
    JV, Mar 30, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scupper

    DHTML Behaviors and ASP.NET

    Scupper, May 28, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    463
    Vidar Petursson
    May 28, 2004
  2. =?Utf-8?B?RGF2aWQgVGlsbWFu?=

    Slow ASP .NET app with DHTML behaviors

    =?Utf-8?B?RGF2aWQgVGlsbWFu?=, Aug 31, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    462
    Juan T. Llibre
    Aug 31, 2005
  3. JV

    DHTML Behaviors (HTC) in a custom server control

    JV, Mar 25, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    144
  4. Mark Kremers

    Behaviors in Behaviors

    Mark Kremers, Jul 31, 2003, in forum: Javascript
    Replies:
    0
    Views:
    118
    Mark Kremers
    Jul 31, 2003
  5. no spam
    Replies:
    1
    Views:
    144
    Tom Cole
    Aug 18, 2006
Loading...

Share This Page