Professional Web Applications Themes

Call method when data sent - ASP.NET General

Hi, I have programmed a module, but I have a small problem. I need to call a method but after the data has been sent to the client (or when the client is disconnected). Which event can I use? and is this possible? Thanx...

Sponsored Links
  1. #1

    Default Call method when data sent

    Hi,
    I have programmed a module, but I have a small problem. I need to call
    a method but after the data has been sent to the client (or when the
    client is disconnected).
    Which event can I use? and is this possible?

    Thanx
    Sponsored Links
    NET_NET_2003 Guest

  2. #2

    Default Re: Call method when data sent

    Hi,
    I don't think that IsClientConnected would work, I'll show some code:

    public class ModuleTest : IHttpModule
    {
    public void Init(HttpApplication httpApp)
    {
    httpApp.BeginRequest += new EventHandler(this.OnBeginRequest);
    httpApp.EndRequest += new EventHandler(this.OnEndRequest);
    }
    public void OnBeginRequest(object o, EventArgs ea)
    {
    HttpApplication httpApp = (HttpApplication) o;
    httpApp.Response.Write("BeginRequest started <br/>");
    //and may perform also something else
    }
    //After the data has been sent to client,
    //I want to call a specific method.
    //The event EndRequest will be fired when the worker
    //process has finished his job,
    //and doesn't mean that the client has received data.
    //So I tried the following:
    public void OnEndRequest(object o, EventArgs ea)
    {
    HttpApplication httpApp = (HttpApplication) o;
    while(httpApp.Response.IsClientConnected)
    {
    }
    httpApp.Response.Write("Client is no more connected<br/>");
    }
    }
    But this did not work, it never returns :(
    I hope that somebody would be able to help

    Thanx


    "Ravikanth[MVP]" <com> wrote in message news:<0ba801c36713$fa46f660$gbl>... 
    NET_NET_2003 Guest

  3. #3

    Default Re: Call method when data sent

    any ideas?
    NET_NET_2003 Guest

Similar Threads

  1. Call plugin method
    By athirukk in forum Adobe Acrobat SDK
    Replies: 0
    Last Post: December 21st, 09:06 PM
  2. using the 'call()' method
    By dubya in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: October 6th, 03:28 PM
  3. How to call a web method using http get/post?
    By mehdi_mousavi in forum ASP.NET Web Services
    Replies: 4
    Last Post: May 3rd, 05:37 AM
  4. lost web method call after several submit
    By Linda Chen in forum ASP.NET Web Services
    Replies: 0
    Last Post: September 26th, 06:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139