我如何才能回发的asp.net保存变量? 我使用HttpContext.Current.Items但回发后总是部署是否有任何其他选项来做到这一点?
How can I save variables in asp.net between postback? I'm using HttpContext.Current.Items but it always disposes after postback is there any other option to do that?
推荐答案
如果您的变量不是可序列化或你不希望客户端能够阅读它的价值=>使用InProc会话
If your variable is not serializable or you do not want the client to be able to read its value => use inProc Session
如果您的变量是序列化,你不希望客户端能够阅读它的价值=>使用数据库会话
If your variable is serializable and you do not want the client to be able to read its value => use database Session
如果您的变量是序列化,你可以住与客户端阅读它的价值,它应该只在页面的范围回传序列中生活=>你应该使用ViewState的。
if your variable is serializable, and you can live with the client reading its value, and it should only live during the postbacks sequence in the scope of the page => you should use ViewState.
相关推荐
最新文章