470,563 Members | 2,374 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,563 developers. It's quick & easy.

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 2060
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Keith Chadwick | last post: by
6 posts views Thread by Daves | last post: by
2 posts views Thread by Shapper | last post: by
2 posts views Thread by parez | last post: by
8 posts views Thread by SStory | last post: by
15 posts views Thread by =?Utf-8?B?UGF0Qg==?= | last post: by
10 posts views Thread by ma | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.