Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7860853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:28:03+00:00 2026-06-02T22:28:03+00:00

I have a custom HttpModule, which handles if a user need to pay a

  • 0

I have a custom HttpModule, which handles if a user need to pay a invoice. If the user has made a postback, but is “caught” in the invoice section of my HttpModule, I would like to repost the original postback, that the user made, after the invoice has been paid, so the user does not have to start over.

Example:

  1. The user fill out a form and submit it to the server
  2. The HttpModule identifies that the user has an unpaid invoice, and redirects the user to the payment page
  3. The user pays the bill
  4. The original post from point 1 is reposted and the user can continue

I’ve tried saving the HttpContext (from HttpContext.Current) in the session state and setting HttpContext.Current to the value in the session, when the bill has been paid, but it does not work.

Is it possible to reuse a postback after the HttpModule has interrupted the normal flow?

My HttpModule looks like this:
class UnpaidInvoiceHttpModule : IHttpModule
{
private HttpApplication cHttpApp;

    public void Dispose(){}

    public void Init(HttpApplication context)
    {
        cHttpApp = context;
        context.PreRequestHandlerExecute += new EventHandler(CheckForUnpaidInvoices);
    }

    private void CheckForUnpaidInvoices(Object s, EventArgs e)
    {
        if (HttpContext.Current.Request.Path.EndsWith(".aspx") || HttpContext.Current.Request.Path.EndsWith(".asp") || HttpContext.Current.Request.Path == "/")
        {
            if (HttpContext.Current.Request.Path != "/login.aspx" 
                && HttpContext.Current.Request.Path != "/Payment/Default.aspx"
                && HttpContext.Current.Request.Path != "/Payment/Default_notice.aspx" 
                && HttpContext.Current.User != null)
            {
                if (HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    CustomUser mUser = ManagerSecurity.SecurityAPI.GetUser();      
                    if (mUser.HasUnpaidInvoices)
                    {
                        HttpContext.Current.Session["prepaymentHttpContext"] = HttpContext.Current;
                        HttpContext.Current.Response.Redirect("/Payment/Default.aspx");
                    }
                    else
                    {
                        if (HttpContext.Current.Session["prepaymentHttpContext"] != null)
                        {
                            HttpContext.Current = (HttpContext)HttpContext.Current.Session["prepaymentHttpContext"];
                        }
                    }
                }
            }
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:28:05+00:00Added an answer on June 2, 2026 at 10:28 pm

    This link should provide you with everything you need to do what you describe. Note that this solution doesn’t delay the post. It immediately reposts the data to a different page. You will have to modify it to store the name/value collection somewhere (perhaps in ViewState on the invoice page, or in a database) so it can be pulled up again after the invoice is paid. When the invoice is paid, you can pull up the name-value collection and pass it to the “redirect and post” method to put the user back on track to their original destination.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webservice which defines a custom httpmodule. I am attempting to launch
I have an httpModule that allows me to have custom urls, but direct the
I have a custom authentication HttpModule that is pretty strait forward. But I want
I have a custom HttpModule rewrite engine in an existing web application project that
I have custom event that has several different subscribers who will all use the
I have custom map image with specific height and width. i need to map
I created my custom assembly that has a simple HttpModule in it that I'd
I have an custom role provider that gets the roles a user belongs to
I am facing a problem where I have to integrate with a custom HttpModule
I have an ASP.net project which involves using a custom IHttpModule. This module will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.