Invoking javascript function from IHttpHandler

Discussion in 'ASP .Net' started by X, Oct 19, 2006.

  1. X

    X Guest

    I am trying to invoke a javascript function from IHttpHandler using
    Context.Response.Write. The function is present in .js file and is not
    being invoked. The following snippet is called from ProcessRequest
    method of the IHttpHandler.

    Code snippet:
    context.Response.Write("<script>window.parent.frames[1].location='../Update.htm';</script>");
    context.Response.Write("<script language='javascript'>\r\n");
    context.Response.Write(string.Format("UpdateNode('{0}', '{1}',
    'true');", _retVal, Id));
    context.Response.Write("</script>");

    Thanks
     
    X, Oct 19, 2006
    #1
    1. Advertising

  2. You don't need to do anything special.

    It should be working.

    How is the .js file being included? Are you doing a
    context.Response.Write("<script src=........"); ??

    Is the javascript below being outputted BEFORE the .js file?

    Karl
    --
    http://www.openmymind.net/
    http://www.fuelindustries.com/


    "X" <> wrote in message
    news:...
    >I am trying to invoke a javascript function from IHttpHandler using
    > Context.Response.Write. The function is present in .js file and is not
    > being invoked. The following snippet is called from ProcessRequest
    > method of the IHttpHandler.
    >
    > Code snippet:
    > context.Response.Write("<script>window.parent.frames[1].location='../Update.htm';</script>");
    > context.Response.Write("<script language='javascript'>\r\n");
    > context.Response.Write(string.Format("UpdateNode('{0}', '{1}',
    > 'true');", _retVal, Id));
    > context.Response.Write("</script>");
    >
    > Thanks
    >
     
    Karl Seguin [MVP], Oct 19, 2006
    #2
    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. lapin
    Replies:
    0
    Views:
    763
    lapin
    Nov 18, 2003
  2. lapin
    Replies:
    1
    Views:
    2,296
    Teemu Keiski
    Nov 19, 2003
  3. Spartanicus
    Replies:
    3
    Views:
    461
    Spartanicus
    Sep 30, 2005
  4. Rahul
    Replies:
    9
    Views:
    446
    Andrey Tarasevich
    Mar 25, 2008
  5. Mike Gleason jr Couturier

    IHttpHandler to inject JavaScript?

    Mike Gleason jr Couturier, Sep 24, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    424
    Mike Gleason jr Couturier
    Sep 24, 2008
Loading...

Share This Page