关于保存状态的 ASP.net 页面持久性

发布于 2024-12-13 16:32:02 字数 361 浏览 6 评论 0原文

目前,我有一个链接到另一个页面的 ASP.NET Web 应用程序。最终用户单击响应重定向到验证页面的链接。这可以正常工作,他们完成验证页面和此响应。将他们重定向回他们开始的初始页面。具体问题是,当用户返回初始页面时,他们之前完成的任何工作现在都消失了(又名填写文本框/下拉菜单等)。我一直在审查确保这种情况不会继续发生的最佳方法,并且一切似乎都指向在重定向到验证页面之前保存页面的视图状态,然后在返回到验证页面时重新加载此视图状态初始页面。虽然,我觉得使用 response.redirects 不会允许这种情况发生。现在,如果最终用户只需单击后退按钮,那么这就会起作用。基本上,我的问题是将最终用户输入的数据保留在初始页面上。任何想法/想法/建议将不胜感激。请放轻松,因为这是我在这里的第一篇文章。谢谢。

Currently, I have an asp.net web application that links to another page. The enduser clicks on a link which response.redirects to a validation page. This works correctly they finish with the validation page and this response.redirects them back to the initial page that they started on. The specific problem is that when the user is brought back to the initial page any work that they had previously completed is now gone (aka filling in textboxes/dropdowns etc.). I have been reviewing the best way of making sure this doesn't continue to occur and everything seems to be pointing to saving the view state of the page prior to redirecting to the validation page, and then reloading this view state upon coming back to the initial page. Although, I fell like using response.redirects will not allow this to occur. Now if the end user was just clicking the back button then this would work. Basically, my problem is keeping the data that my enduser input present on the initial page. Any thoughts/ideas/suggestions will be greatly appreciated. Please go easy as it is my first post here. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紧拥背影 2024-12-20 16:32:02

我不确定这是否会解决您的问题,但很久以前就有一个想法将 ViewState 存储在服务器上并按需恢复。

这是以放弃验证为代价的。我记得我稍微调整了一下:

http://netpl.blogspot。 com/2007/11/persistentstatepage-with-event.html

我希望您会发现它很有用。

I am not sure whether or not this will solve your issues but long time ago there was an idea to store the ViewState on the server and restore it on demand.

http://www.codeproject.com/KB/applications/persistentstatepage.aspx

This came at a price of turning of the validation. I remember I tweaked it a little bit:

http://netpl.blogspot.com/2007/11/persistentstatepage-with-event.html

I hope you'll find it useful.

☆獨立☆ 2024-12-20 16:32:02

我建议您查看这篇文章:9 种保存用户统计信息的方法

州的选择实际上取决于您以及您的应用程序的要求。它有点旧(2003 年),但对于用户状态来说是一个很好的指南。

I will suggest looking at this article: 9 ways to persist user stat

Which state choice is really up to you and what your application requires. Its a little old (2003) but a good guide to user state.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文