473,835 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1055
Hi,
I don't think that IsClientConnect ed would work, I'll show some code:

public class ModuleTest : IHttpModule
{
public void Init(HttpApplic ation httpApp)
{
httpApp.BeginRe quest += new EventHandler(th is.OnBeginReque st);
httpApp.EndRequ est += new EventHandler(th is.OnEndRequest );
}
public void OnBeginRequest( object o, EventArgs ea)
{
HttpApplication httpApp = (HttpApplicatio n) o;
httpApp.Respons e.Write("BeginR equest 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(ob ject o, EventArgs ea)
{
HttpApplication httpApp = (HttpApplicatio n) o;
while(httpApp.R esponse.IsClien tConnected)
{
}
httpApp.Respons e.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*********@ho tmail.com> wrote in message news:<0b******* *************** ******@phx.gbl> ...
Hi

The following example takes action if the client is
currently connected.
[C#]
if (Response.IsCli entConnected == 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
11457
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 is that this form can only, from my understanding, execute a separate PHP file with the <form action=removerow.php> code. Or can I call a function? The reason being I find that the form will only pass a single variable to this "removerow.php"...
15
3137
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. When I find is that if I send the value by the GET method, response.write("From QueryString: " & Request.QueryString("usernamefromform") & "<br><br>")
7
1505
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, but it looks like tlbimp has imported the call in a way that I can't figure out how to get my data in. SDK: VARIANT_BOOL ReadMemory(unsigned char* Data, long DataSize); IL file:
4
4299
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 I know I need to call a function that will save data but I'm not sure exactly when to call this function. I've tried two ways and both seem to have 'gotcha's':
4
2950
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
4200
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 BL object method actually sets up a delegate and calls a private method asynchronously and immediately returns back to the web page. The problem I am having is that the async call never happens. I added a quick logging call immediately as the...
11
11541
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 function whether i click the link then i tried this (using forms)
7
3315
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 object is a reference type? my code is not proving that. I have a web project i created from a web service that is my object: public class ExcelService : SoapHttpClientProtocol {
6
1549
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 below can I call x.a.p1() and get the output
0
9802
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9652
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10558
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7765
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6961
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5631
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3990
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3086
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.