Save and recovering post data

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!
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top