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

Home Posts Topics Members FAQ

Application Start

Hi , it´s me again.

I will take another way because yesterday I make a question and,
probably I didn´t make myself clear so you didn´t understand my question.

I want to know if there is any way to register a method to the
Application Start event. I know there is one way, in Global.asax writing
code in

Application_Sta rt

but this way is not possible for me because I need to do it without
implementing those methods in global.asax

What i need is something like:

AnyDotNetFramew orkClass.Applic ationStart += new EventHandler(My _Method);

Do you know if ApplicacionStar t event is declared somewhere on the
framework so I can register to it?
Thanks in advance

Fernando Arámburu
Nov 19 '05 #1
16 3153
Have you tried making an httpmodule to do this?

KG

"Fernando Arámburu" <fe************ **@speedy.com.a r> wrote in message
news:Ou******** ******@TK2MSFTN GP10.phx.gbl...
Hi , it´s me again.

I will take another way because yesterday I make a question and,
probably I didn´t make myself clear so you didn´t understand my question.

I want to know if there is any way to register a method to the
Application Start event. I know there is one way, in Global.asax writing
code in

Application_Sta rt

but this way is not possible for me because I need to do it without
implementing those methods in global.asax

What i need is something like:

AnyDotNetFramew orkClass.Applic ationStart += new
EventHandler(My _Method);

Do you know if ApplicacionStar t event is declared somewhere on the
framework so I can register to it?
Thanks in advance

Fernando Arámburu

Nov 19 '05 #2
Well, you can implement a Custom HTTP Module:
http://msdn.microsoft.com/library/de...ttpmodules.asp

which has the init() method....

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Fernando Arámburu" <fe************ **@speedy.com.a r> wrote in message
news:Ou******** ******@TK2MSFTN GP10.phx.gbl...
Hi , it´s me again.

I will take another way because yesterday I make a question and,
probably I didn´t make myself clear so you didn´t understand my question.

I want to know if there is any way to register a method to the
Application Start event. I know there is one way, in Global.asax writing
code in

Application_Sta rt

but this way is not possible for me because I need to do it without
implementing those methods in global.asax

What i need is something like:

AnyDotNetFramew orkClass.Applic ationStart += new EventHandler(My _Method);
Do you know if ApplicacionStar t event is declared somewhere on the
framework so I can register to it?
Thanks in advance

Fernando Arámburu

Nov 19 '05 #3
HttpModules can't handle the Application_Sta rt, Application_End , Session_Start
or Session_End events. They aren't proper events -- there's code in ASP.NET
that's hard coded to look for these and call them directly.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Have you tried making an httpmodule to do this?

KG

"Fernando Arámburu" <fe************ **@speedy.com.a r> wrote in message
news:Ou******** ******@TK2MSFTN GP10.phx.gbl...
Hi , it´s me again.

I will take another way because yesterday I make a question and,
probably I didn´t make myself clear so you didn´t understand my
question.

I want to know if there is any way to register a method to the
Application Start event. I know there is one way, in Global.asax
writing code in

Application_Sta rt

but this way is not possible for me because I need to do it without
implementing those methods in global.asax

What i need is something like:

AnyDotNetFramew orkClass.Applic ationStart += new
EventHandler(My _Method);

Do you know if ApplicacionStar t event is declared somewhere on the
framework so I can register to it?
Thanks in advance
Fernando Arámburu


Nov 19 '05 #4
Thanks for the answer.
Even though it does not help too much to my problem, just thanks for telling
me that bad thing I was thinking on: "it´s only a hardcode and there are no
events"
REALLY BAD NEWS.
Thanks again.

Fernando Arámburu
"Brock Allen" <ba****@NOSPAMd evelop.com> escribió en el mensaje
news:19******** **************@ msnews.microsof t.com...
HttpModules can't handle the Application_Sta rt, Application_End , Session_Start or Session_End events. They aren't proper events -- there's code in ASP.NET that's hard coded to look for these and call them directly.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Have you tried making an httpmodule to do this?

KG

"Fernando Arámburu" <fe************ **@speedy.com.a r> wrote in message
news:Ou******** ******@TK2MSFTN GP10.phx.gbl...
Hi , it´s me again.

I will take another way because yesterday I make a question and,
probably I didn´t make myself clear so you didn´t understand my
question.

I want to know if there is any way to register a method to the
Application Start event. I know there is one way, in Global.asax
writing code in

Application_Sta rt

but this way is not possible for me because I need to do it without
implementing those methods in global.asax

What i need is something like:

AnyDotNetFramew orkClass.Applic ationStart += new
EventHandler(My _Method);

Do you know if ApplicacionStar t event is declared somewhere on the
framework so I can register to it?
Thanks in advance
Fernando Arámburu


Nov 19 '05 #5
HttpModule can´t manage Application Start and Session Start. I only need to
catch those moments and I can´t do that in Global.asax file because I can´t
put code in user code.
I´m working on a Framework that programmers use to improve some ASP.NET
features I can´t put code in user code.
Thanks for the answer.

Fernando Arámburu

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
escribió en el mensaje news:uH******** ******@TK2MSFTN GP15.phx.gbl...
Well, you can implement a Custom HTTP Module:
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconcustomhttp modules.asp
which has the init() method....

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Fernando Arámburu" <fe************ **@speedy.com.a r> wrote in message
news:Ou******** ******@TK2MSFTN GP10.phx.gbl...
Hi , it´s me again.

I will take another way because yesterday I make a question and,
probably I didn´t make myself clear so you didn´t understand my question.
I want to know if there is any way to register a method to the
Application Start event. I know there is one way, in Global.asax writing
code in

Application_Sta rt

but this way is not possible for me because I need to do it without
implementing those methods in global.asax

What i need is something like:

AnyDotNetFramew orkClass.Applic ationStart += new

EventHandler(My _Method);

Do you know if ApplicacionStar t event is declared somewhere on the
framework so I can register to it?
Thanks in advance

Fernando Arámburu


Nov 19 '05 #6
Why can't you just have a type initializer (static constructor)? This is
an easy way to get one-time initilization semantics.

public class MyClass
{
static MyClass()
{
// do your one-time init here
}
}

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi , it´s me again.

I will take another way because yesterday I make a question and,
probably I didn´t make myself clear so you didn´t understand my
question.

I want to know if there is any way to register a method to the
Application Start event. I know there is one way, in Global.asax
writing code in

Application_Sta rt

but this way is not possible for me because I need to do it without
implementing those methods in global.asax

What i need is something like:

AnyDotNetFramew orkClass.Applic ationStart += new
EventHandler(My _Method);

Do you know if ApplicacionStar t event is declared somewhere on the
framework so I can register to it?
Thanks in advance
Fernando Arámburu


Nov 19 '05 #7
Static constructors are lazy-loaded...meanin g it won't necessarily run on
application start, but rather when the first member (static or instance) of
the class is called...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:19******** **************@ msnews.microsof t.com...
Why can't you just have a type initializer (static constructor)? This is
an easy way to get one-time initilization semantics.

public class MyClass
{
static MyClass()
{
// do your one-time init here
}
}

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi , it´s me again.

I will take another way because yesterday I make a question and,
probably I didn´t make myself clear so you didn´t understand my
question.

I want to know if there is any way to register a method to the
Application Start event. I know there is one way, in Global.asax
writing code in

Application_Sta rt

but this way is not possible for me because I need to do it without
implementing those methods in global.asax

What i need is something like:

AnyDotNetFramew orkClass.Applic ationStart += new
EventHandler(My _Method);

Do you know if ApplicacionStar t event is declared somewhere on the
framework so I can register to it?
Thanks in advance
Fernando Arámburu


Nov 19 '05 #8
And where am I working with Application Start and Session Start? I mean, you
are talking about one-time initialization that is completely different from
what i need. I need to some things when Application Start and when Session
Start.

Fernando Arámburu

"Brock Allen" <ba****@NOSPAMd evelop.com> escribió en el mensaje
news:19******** **************@ msnews.microsof t.com...
Why can't you just have a type initializer (static constructor)? This is
an easy way to get one-time initilization semantics.

public class MyClass
{
static MyClass()
{
// do your one-time init here
}
}

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi , it´s me again.

I will take another way because yesterday I make a question and,
probably I didn´t make myself clear so you didn´t understand my
question.

I want to know if there is any way to register a method to the
Application Start event. I know there is one way, in Global.asax
writing code in

Application_Sta rt

but this way is not possible for me because I need to do it without
implementing those methods in global.asax

What i need is something like:

AnyDotNetFramew orkClass.Applic ationStart += new
EventHandler(My _Method);

Do you know if ApplicacionStar t event is declared somewhere on the
framework so I can register to it?
Thanks in advance
Fernando Arámburu


Nov 19 '05 #9
Yes of course. But for many scenarios this is perfectly acceptable.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Static constructors are lazy-loaded...meanin g it won't necessarily run
on application start, but rather when the first member (static or
instance) of the class is called...

Karl


Nov 19 '05 #10

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

Similar topics

12
2953
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am starting is that it has a welcome window first which gets displayed and then the real windows after a while,in other words it means that the process name is the same, but the handle I need to retrive is the one from the final window and not the...
6
20087
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are quite a few words in this post but the questions are actually quite similar and should be fairly quick to answer ... (1) What is Happening with the Threads
2
3884
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I have an exe application that I want to start remotely.Once I start the application, I want to press ok to that application. To start the application, I did Process.start("C://test/app.exe"). I am writing this code in a C# web application, famework 1.1 How can I press ok to that started application. Any help will be apprecaited
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...
0
1019
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...
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...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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
5354
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...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.