473,394 Members | 1,709 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,394 software developers and data experts.

Intermediate Class between HttpApplication and Global

Hy everybody,

I´m working on an ASP.NET framework and and I need to extend
System.Web.HttpApplication. I mean, I need to put some intermediate class
between System.Web.HttpApplication and Global class on Global.asax file.
What I need, in code, is the following:

public class MyhttpApplication : System.Web.HttpApplication

and then , Global class extends myHttpApplication

public class Global : MyHttpApplication

Till now, everything is ok, because nothing strange in on that. The
problem I found is that I need that both my class (MyHttpApplication) and
the Global class (on the Global.asax file) listen the same events or can
write code for the same events, for example,Session_Start y
Application_Start..
Why do I need this? Because I need to let the programmer works as he works
when Global extend HttpApplication and I also need to listen those events
because My Framework do something when those event ocurr.

The real problem is that ASP.NET at compile time, it generates explicit
calls to Application_Start and Session_Start using Object_Event way.

protected void Application_Start(Object sender, EventArgs e)
{
}

so I can´t have Application_Start on both my class (MyHttpApplication) and
the Global class, because is not possible to define the same method
signature without using the override, new or any keyword that may help.

I hope somebody has understood my problem and provide me a good solution
for my problem. I really need help cause my class needs to listen to those
events but I must let programmers to also listen to those events as the way
they did before.

Thanks in advance.

Fernando Arámburu
Nov 19 '05 #1
1 2209
Hello Fernando,

If Im not mistaken, you are probably after an IHttpModule [1]. There's an
article [2] that discusses an implementation available on MSDN.

[1] http://msdn.microsoft.com/library/de...ClassTopic.asp
[2] http://msdn.microsoft.com/library/de...ilterInASP.asp

--
Matt Berther
http://www.mattberther.com
Hy everybody,

I´m working on an ASP.NET framework and and I need to extend
System.Web.HttpApplication. I mean, I need to put some intermediate
class
between System.Web.HttpApplication and Global class on Global.asax
file.
What I need, in code, is the following:
public class MyhttpApplication : System.Web.HttpApplication

and then , Global class extends myHttpApplication

public class Global : MyHttpApplication

Till now, everything is ok, because nothing strange in on that.
The
problem I found is that I need that both my class (MyHttpApplication)
and
the Global class (on the Global.asax file) listen the same events or
can
write code for the same events, for example,Session_Start y
Application_Start..
Why do I need this? Because I need to let the programmer works as he
works
when Global extend HttpApplication and I also need to listen those
events
because My Framework do something when those event ocurr.
The real problem is that ASP.NET at compile time, it generates
explicit calls to Application_Start and Session_Start using
Object_Event way.

protected void Application_Start(Object sender, EventArgs e)
{
}
so I can´t have Application_Start on both my class (MyHttpApplication)
and the Global class, because is not possible to define the same
method signature without using the override, new or any keyword that
may help.

I hope somebody has understood my problem and provide me a good
solution for my problem. I really need help cause my class needs to
listen to those events but I must let programmers to also listen to
those events as the way they did before.

Thanks in advance.

Fernando Arámburu


Nov 19 '05 #2

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

Similar topics

2
by: Jerry | last post by:
My "main" class is getting a bit long...Is it possble to split a class definition into several files and then import the pieces to get the whole definition? Jerry
7
by: [Gauthier] | last post by:
Hello, I've a simple question: On a server that run multiple asp.net HttpApplication, is there any way with the asp.net framework to exchange data between different application? I basically...
2
by: Keith Chadwick | last post by:
Need some help on access the httpApplication cache. I was informed to use the application cache over the old application object and also to use a classes versus modules. do I need to Imprt...
6
by: Daves | last post by:
can anyone imagine why I cannot access static variables in my global class from other pages, eg: myNumber = myGlobal.UserID; where global.asax contains: <%@ Application Language="C#"...
2
by: Shapper | last post by:
Hello, In the main root of my web site together with my aspx and aspx.vb files I have the file global.vb. This file has a class with all the functions which are used in many aspx.vb files and...
2
by: parez | last post by:
Hi all! How many instances of the class httpapplication exist for a single webserver? Does it depened on the on the number of processors? I have a timer associated with the app and its...
8
by: SStory | last post by:
When I right a class, I am wondering what are the best practices for error handling? Do I try..catch and trap the error and if so what do I do with it? Because most likely the class user will...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
10
by: ma | last post by:
Hello, I want to create a global class. To do this I did the followings: 1- Create a class name test. It has a public variable named mystring. public class test { public string mystring =...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...
0
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,...
0
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...

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.