사용자가 인보이스를 지불해야하는 경우 처리하는 사용자 정의 HttpModule이 있습니다. 사용자가 포스트 백을했지만 내 HttpModule의 인보이스 섹션에 "catch"되어있는 경우 인보이스 결제 후 사용자가 시작하지 않아도 원래 포스트 백을 다시 게시하고 싶습니다. 위에.HttpModule에서 포스트 백 데이터 재사용
예 :
- 사용자 양식을 작성하고 서버에 제출
- HttpModule을 사용자가 무급 송장을 가지고 있으며, 지불 페이지
- 받는 사용자를 리디렉션 것을 확인 사용자는 점 1에서 원래의 게시물이 다시 게시하고 사용자가 t
내가했습니다 계속할 수
HttpModule이 정상적인 흐름을 방해 한 후에 포스트 백을 다시 사용할 수 있습니까? 클래스 UnpaidInvoiceHttpModule :
내 HttpModule을은 다음과 같습니다 IHttpModule { 개인 같이 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"];
}
}
}
}
}
}
}
세션에서 사용자가 입력 한 데이터를 저장할 수 없으며 지불 페이지 처리가 완료된 후에이 세션 데이터를 추가 처리에 사용할 수 있습니까? – Krishna
@Krishna 그게 내가 시도한 것이지만, 제대로 작동하지 않는 것 같습니다. 어쩌면 내가 잘못하고있는거야? 나는 이런 식으로 일을 시도했습니다 '경우 (! HttpContext.Current.Session [ "prepaymentHttpContext"] = NULL) { HttpContext.Current = (HttpContext를) HttpContext.Current.Session [ "prepaymentHttpContext"]; }' –
'HttpContext.Current = (HttpContext) HttpContext.Current.Session [ "prepaymentHttpContext"];'로 라인에 실제로 충돌합니까? 나는 리다이렉트가 "/Payment/Default.aspx"- page에 새로운 클라이언트 포스트를 만들고 현재 세션을 저장하지 않는다고 생각하고 있습니다. if-block에서 세션의 데이터를 저장 한 다음 지불 페이지로 서버를 전송합니다. * 리디렉션이 필요하지 않기 때문에 서버가 전송됩니다. –