有没有办法在后续页面之间维护页面控制值 [英] Is there any way to maintain page control values between subsequent pages
本文介绍了有没有办法在后续页面之间维护页面控制值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在后续页面之间维护页面控制值。其他会话,QueryString,Cookie和Cache?如果不是那么这个选项会更好吗?
我尝试了什么:
我已经完成了会话但是如果还有其他任何方式请建议。
解决方案
基本上没有 - 您可以将它们存储在数据库中,但是您仍然需要两个页面共有的一些信息才能恢复它们 - 例如用户ID。没有它,您无法恢复特定于用户当前体验的设置。
我的工作方式是将设置存储在DB中的UserId,并将UserId存储在会话或Cookie(取决于我需要多长时间的信息)。
如果他们在会话中工作正常,那么这是一个很好的方式去。
Is there any way to maintain page control values between subsequent pages. other then session, QueryString, Cookie and Cache? If not then which will be better from this options?
What I have tried:
I have done it with session but if there is any other way then please suggest.
解决方案
Basically, no - you can store them in a DB, but then you still need some information that is common to the two pages in order to restore them - a user id for example. Without that, you can't restore the settings that are specific to the users "current experience".
The way I do things is to store the settings in DB by UserId, and store the UserId in the Session or a Cookie (depending on how long I need the information to be current for).
If they are working fine in the Session, then that's a good way to go.
这篇关于有没有办法在后续页面之间维护页面控制值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文