让会议只读的asp.net编程(的EnableSessionState ="只读") [英] Make session readonly on asp.net programmatically (EnableSessionState="ReadOnly")

查看:114
本文介绍了让会议只读的asp.net编程(的EnableSessionState ="只读")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在会议只读这样我就可以建立多个请求到使用会话变量的页面,但在只读模式。

I need to make the session readonly so I can establish multiple requests to a page that uses sessions variables but in the readonly mode.

由于所有的过程中对我的服务器控件执行我需要一种方法来使会话只读编程。

Since all the process are performed on my server control I need a way to make the session readonly programmatically.

推荐答案

在您的情况下,必须有一个页面谁可以写会话和其他无权写在上面。直到请求完成具有会话状态写访问页面将举行会议作家锁。一个页面的收益通过设置@Page指令为True的EnableSessionState属性写访问会话状态。有会话状态的页面读取,例如访问时的EnableSessionState属性设置为只读,将举行会议读者锁直到请求结束。

In your scenario there must be one page who can write on session and other have no right to write on it. page that has session-state write access will hold a writer lock on the session until the request finishes. A page gains write access to the session state by setting the EnableSessionState attribute on the @Page directive to True. A page that has session-state read access for example, when the EnableSessionState attribute is set to ReadOnly, will hold a reader lock on the session until the request finishes.

<% @Page EnableSessionState="ReadOnly" %>

有关更多信息,你可以阅读链接

这篇关于让会议只读的asp.net编程(的EnableSessionState =&QUOT;只读&QUOT;)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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