使用ReadEntityBody并将表单数据持久保存到页面 [英] using ReadEntityBody and persisting form data to the page

查看:208
本文介绍了使用ReadEntityBody并将表单数据持久保存到页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义的HttpModule,它使用ReadEntityBody来监控文件上传状态。它工作得很好,然而,似乎通过使用ReadEntityBody,我短路自然请求,表单数据永远不会持久存在页面。 Page看到有一个PostBack,但是如果我探索Request.Params,表单帖子中实际上没有任何表单数据。如果我注释掉ReadEntityBody,表单数据就在那里。那么如何在回发期间将这些数据保存到Page而不必将表单数据存储在文件或静态类管理器中。

I have a custom HttpModule that uses ReadEntityBody to monitor file upload statuses. It works great, however, it seems by using ReadEntityBody, I'm "short circuiting" the natural request and the form data is never persisted to the page. The Page sees that there is a PostBack, but if I explore Request.Params, none of the form data is actually persisted from the form post. If I comment out the ReadEntityBody, the form data is there. So how can I persist this data to Page during post back without having to store the form data in a file or a static class manager.

推荐答案

我知道,这是旧。但是,我认为我会更新一些信息,因为我遇到了类似的问题。



我开发了一个原生的IIS模块,我使用ReadEntityBody API来读取POST请求数据。这简短了请求处理和浏览器没有得到任何响应。



我更改了代码以存储使用ReadEntityBody读取的数据并使用InsertEntityBody重新插入请求正文。添加完成后,处理请求并在浏览器中看到响应。
I know, this is old. But, I thought I will update some information as I have undergone a similar issue.

I have developed a native IIS module, where I used ReadEntityBody API to read the POST request data. This short circuited the request handling and the browser was not getting any response.

I changed the code to store the data which is read using ReadEntityBody and used InsertEntityBody to re-insert the request body. After adding this, the requests were processed and the response was seen in the browser.


这篇关于使用ReadEntityBody并将表单数据持久保存到页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆