Custom HTTP Module help

S

spartanNTX

Hello,
I am trying to create a custom HTTP module implementing
the IHttpModule interface. 1 event handler in the module
does not get passed the HttpApplication as an argument
when it is called. I need to Response.Redirect the user
after this event has taken place and I can not find a way
to access the Response object.
I have tried setting a class member variable equal to
the httpapplication object in the init method and also I
have tried creating a new HttpApplication() object but
neither seems to have any effect. Does anyone please have
any suggestions? Here are the two things I have tried:


private HttpApplication currentContext;//set in init()

public void CmsPosting_Approved( Object sender,
ChangedEventArgs e )
{
currentContext.Response.Redirect
("http://www.google.com",true);
}
//not working

//and

public void CmsPosting_Approved( Object sender,
ChangedEventArgs e )
{
HttpApplication app = new HttpApplication();
app.Response.Redirect("http://www.google.com",true);
}
//not working

The (PostingEvents)sender and (ChangedEventArgs)e object
don't contain any usefull methods or properties.

TIA!!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top