473,772 Members | 3,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add delegate to Application Start in HTTP Module

In the Init Method, I would like to add a delegate to the Application_Sta rt.
However the Application_Sta rt is not an event of the HTTPApplication class.
Is there some other way to access this event?
--
Mike Logan
Nov 19 '05 #1
1 1762
What are you trying to do? Application events are app wide, where a module
is typically request wide - thus the app start event does not occur when a
module request comes through the pipeline or it would happen on every
request. Best place for application start is in global.asax.

If you want to attache a delegate, let Init track whether app_start was
already handled using some static boolean (ie first request) - if not then
invoke some code, otherwise dont.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Mike Logan" <Mi*******@comm unity.nospam> wrote in message
news:18******** *************** ***********@mic rosoft.com...
In the Init Method, I would like to add a delegate to the Application_Sta rt. However the Application_Sta rt is not an event of the HTTPApplication class. Is there some other way to access this event?
--
Mike Logan

Nov 19 '05 #2

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

Similar topics

4
2216
by: Tim Werth | last post by:
I am trying to use reflection to add an event handler for the RowUpdated event of the OracleDataAdapter object (ODP.NET), but the same thing can be said for SqlDataAdapter if you only use reflection. The code I supplied is based on the SqlDataAdapter with reflection. The error occurs when trying to create the delegate that will be passed in to EventInfo.AddEventHandler. I get the following error: An unhandled exception of type...
3
10237
by: Alexander | last post by:
Me again.... second time I type this - the post did not work the first time... Similar question as last time, but another problem: I am running a CE.Net Application and I want to show a small borderless dialog which shows an animation, that shows, that the application is still doing something. So far it works until I want to close the dialog. The dialog has a delegate that I want to invoke, which will close it. But I run into a...
5
1099
by: Cosmin Prund | last post by:
Hello everyone. I'm new to c# and I'm trying to use some delegates in my code, so I can do time-tests on whatever I'm doing. In order to do this I tried writing a testing method that will make use of a stopwatch and will take as a parameter a delegate. I've seen this done by Nicholas Paldino in a post and I tried to reproduce it (not copy-paste, but re-type and try to understand). So I start a new Console application project, I remove...
7
1778
by: Ant | last post by:
Hello, Very simple question but one I need clarified. Which part of the statement below is considered the 'delegate'? Is it the 'new System.EventHandler' or the btnAccept_Click? or is it the piece of code which doesn't appear here, but abstracts the btnAccept_Click method?
0
343
by: RSH | last post by:
I am rather new to delegates and I was working through an exersize. I have created a simple commandline project that basically adds or edits customers. I am using two delegates, one to Notify any changes to a customer, and now I want to set a delegate up to Notify of any new customers. My problem is where to place it. With the Notify of changes it was simple because I just instantiate the Delegate after i create the customer object. ...
3
2062
by: eBob.com | last post by:
(Not that size matters, but ...) I have a program which is getting too big. So I'd like to split it into several source files. I know that I can create a ModuleX.vb source file which looks like this ... Module ModuleX Public Sub DoX() MsgBox("message from DoX") End Sub End Module
0
3511
by: R K | last post by:
I am delevoping a Scheduler module whose functionality is to load the Scheduled Item Details every day (For this I have created a System.Threading.TimerCallBack with Timespan 1 day) in a stack. Once the stack is loaded I look for the qualified items every one minute (I create an another TimerCallBack thread). This Scheuler module needs to be started when the UI interface gets loaded. The issue lies in starting the shceduler since the...
0
1544
by: Cramer | last post by:
Using ASP.NET 3.5: Can a custom HTTP Module be used to register for the Application_Start event? Or _must_ I use Global.asax to work with Application.Start? I understand that I can use a custom HTTP Module to register for other pipeline events (like Application.BeginRequest), but I was told that the only place that I can set up an event handler for Application.Start is in Global.asax. My preference would be to register an HTTP Module...
9
3987
by: Bob Altman | last post by:
I'm trying to call a function on a background thread in a C++/CLI (VS 2005) application compiled with /clr. I store a delegate reference in a module-level gcroot. When I call BeginInvoke on the delegate I get a RemotingException. The inner exception says "Pointer types cannot be passed in a remote call". A code example that demonstrates the problem appears below. Am I even wiring up the delegate/BeginInvoke/EndInvoke stuff correctly? ...
0
9454
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,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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
7460
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
6715
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
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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
3
2850
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.