I have created a class for the purpose of URL rewriting below is the code public class:
URLReWriter : IHttpModule
{
private HttpApplication httpApp = null;
/// <summary>
/// Init Method implementation
/// </summary>
/// <param name="context"></param>
void IHttpModule.Init(HttpApplication context)
{
context.BeginRequest += new EventHandler(context_BeginRequest);
httpApp = context;
}
/// <summary>
/// Dispose Method implementation
/// </summary>
void IHttpModule.Dispose()
{
}
}
In the Init
function we are raising an event to call a function context.BeginRequest
and implementing the interface IHttpModule
.
I am implementing the interface IHttpModule
, it has two methods Init
and Dispose
. Now I have aspx
page and trying to call the Init
function from URKReWriter
class like this:
EnergyQuote.Framework.Utilities.URLReWriter obj
= new EnergyQuote.Framework.Utilities.URLReWriter();
but it's not possible. Can we call the Init
function from the aspx
page?