K
Kirsten
I'm implementing a custom IHttpModule. In certain conditions, I need to save
all post data and then inject it back transparently to the client.
1) I'm saving the data like this:
HttpContext.Current.Application[myID] =
HttpContext.Current.Request.InputStream;
2) Then redirect the client to special page. When the user completes some
data, then returns back to the original page.
3) At this point, I need to to recover the data and inject it back, as if
the redirection never happened. But, I can't modify InputStream.
I tried implementing a Stream filter like this
application.BeginRequest += Application_BeginRequest;
.....
void Application_BeginRequest(object sender, EventArgs e)
{
HttpContext.Current.Request.Filter = new
MyStream(HttpContext.Current.Request.Filter);
}
but the problem is that Stream.Read is never called because now there is no
post data (i.e. InputStream.Length = 0)
Any ideas?
Sometime ago (before ASP.NET) I managed to solve this problem with ISAPI
Filters and ECB.ServerSupportFunction(), but I can't a solution in ASP.NET
Thanks a lot!
all post data and then inject it back transparently to the client.
1) I'm saving the data like this:
HttpContext.Current.Application[myID] =
HttpContext.Current.Request.InputStream;
2) Then redirect the client to special page. When the user completes some
data, then returns back to the original page.
3) At this point, I need to to recover the data and inject it back, as if
the redirection never happened. But, I can't modify InputStream.
I tried implementing a Stream filter like this
application.BeginRequest += Application_BeginRequest;
.....
void Application_BeginRequest(object sender, EventArgs e)
{
HttpContext.Current.Request.Filter = new
MyStream(HttpContext.Current.Request.Filter);
}
but the problem is that Stream.Read is never called because now there is no
post data (i.e. InputStream.Length = 0)
Any ideas?
Sometime ago (before ASP.NET) I managed to solve this problem with ISAPI
Filters and ECB.ServerSupportFunction(), but I can't a solution in ASP.NET
Thanks a lot!