httpmodule to inject javascript includes?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SkhpbGJDUk0=?=

    #1

    httpmodule to inject javascript includes?

    I am trying to write a httpmodule to inject javascript includes on some of
    the aspx pages we have.

    For instance, I want to inject into the resulting IIS response something
    like...

    response.Write( "<script language='javas cript'>");
    response.Write( "alert('tt');") ;
    response.Write( @"</script>");

    I kind of got it working. But I am wondering what the best httpmodule event
    to hook into is? I want the code to inject right at the end of the web page.

    Jeff


  • John Timney \(MVP\)

    #2
    Re: httpmodule to inject javascript includes?

    I would go for OnEndRequest, given its the last event to occur.

    Regards

    John Timney (MVP)





    "JHilbCRM" <JHilbCRM@discu ssions.microsof t.comwrote in message
    news:7A21E4B0-4442-4C93-B3F6-929536D96720@mi crosoft.com...
    >I am trying to write a httpmodule to inject javascript includes on some of
    the aspx pages we have.
    >
    For instance, I want to inject into the resulting IIS response something
    like...
    >
    response.Write( "<script language='javas cript'>");
    response.Write( "alert('tt');") ;
    response.Write( @"</script>");
    >
    I kind of got it working. But I am wondering what the best httpmodule
    event
    to hook into is? I want the code to inject right at the end of the web
    page.
    >
    Jeff
    >
    >

    Comment

    Working...