如何存储价值&访问从不同的页面 [英] How To Store a value & access From different pages

查看:65
本文介绍了如何存储价值&访问从不同的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在网站上存储价值,可以在网站的任何页面访问....



我用过

1)申请状态

2)缓存



它存储一个值,覆盖到之前的值



例如



user1 ----有权访问页面并且值存储在应用程序状态/缓存中 - Hello



注意:[仍然是用户1在线并在同一页面上]



之后



user2 ---有权访问页面,值存储在应用程序状态/缓存中 - 嗨



但是当user1访问同一页面或某个其他页面时,值被更改并被user2的值覆盖,即嗨



这是什么... ...........



我也使用了Session,但是过了一段时间它已经过期或者是由某个页面的另一个值写的用于在会话中存储一些价值....





所以,需要帮助......................... ................................

how can i store value in website & can be accessed be in any page of the website ....

I have used
1) Application State
2) Cache

it store a single value which is overwrites to previous value

Eg

user1---- have access a page and a value is store in application State/ Cache - "Hello"

Note: [ still user1 is online & on the same page ]

after that

user2--- have access a page and a value is store in application State/ Cache - "Hi"

but when user1 access the same page or some other page the value is changed and to overwrite by the value of user2 i.e "Hi"

What is this ..............

I have also used Session , But after sometime it got expired or over written by another value of some page which also use to store some value in session ....


So , Help Needed.........................................................

推荐答案

有您考虑过Cookie: http://msdn.microsoft.com/en-GB /library/ms178194(v=vs.100).aspx [ ^ ]它们存储在客户端上,可以设置为不过期,您可以根据需要创建尽可能多的特殊值。
Have you considered Cookies: http://msdn.microsoft.com/en-GB/library/ms178194(v=vs.100).aspx[^] They are stored on the client, and can be set to not expire, and you can create as many spearate vlaues as you need.


这篇关于如何存储价值&访问从不同的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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