Custom HTTP Module help

Discussion in 'ASP .Net' started by spartanNTX, Nov 13, 2003.

  1. spartanNTX

    spartanNTX Guest

    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!!!!!
     
    spartanNTX, Nov 13, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cybermedia Marketing

    Adding custom server variables from http module

    Cybermedia Marketing, Oct 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    536
    Cybermedia Marketing
    Oct 15, 2003
  2. Jiong Feng
    Replies:
    2
    Views:
    559
    Wade A. Hilmo [MS]
    Nov 29, 2003
  3. Cramer
    Replies:
    0
    Views:
    605
    Cramer
    Apr 23, 2008
  4. Replies:
    1
    Views:
    1,028
  5. Leslie
    Replies:
    3
    Views:
    514
    Dominick Baier [DevelopMentor]
    May 26, 2005
Loading...

Share This Page