473,378 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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
Nov 17 '05 #1
2 1034
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]" <dv*********@hotmail.com> wrote in message news:<0b****************************@phx.gbl>...
Hi

The following example takes action if the client is
currently connected.
[C#]
if (Response.IsClientConnected == true)
{
//...
}

Nov 17 '05 #2
any ideas?
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Titus Cheung | last post by:
Hello, I want to write some code such that it'll update (ie insert, delete, etc) some data to/from a mySQL database whenever a user hit an HTML form button (ie Submit). Now what I find annoying...
15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
7
by: Gabe Covert | last post by:
I'm attempting to implement a 3rd party COM library in a C# application, and have run up against the following problem in my development. I am trying to use a particular method call of an object,...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
4
by: VB Programmer | last post by:
Can someone provide a simple explanation on the difference between the GET and POST methods? What are the adv/disadv of both and when should I use them? Thanks.
5
by: Stephen Barrett | last post by:
I have read many threads related to async fire and forget type calls, but none have addressed my particular problem. I have a webpage that instantiates a BL object and makes a method call. The...
11
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
7
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
6
by: mh | last post by:
I am instantiating a class A (which I am importing from somebody else, so I can't modify it) into my class X. Is there a way I can intercept or wrape calls to methods in A? I.e., in the code...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.