- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我到处搜索这个解决方案。任何见解将不胜感激。
情况:当在单个页面中有多个 PageMethod 调用时,每个方法调用都持有 Session 对象的锁,从而阻塞。只有当 @Page
指令变为 False|ReadOnly
调查结果:当 Page
指令为默认(读/写)但页面上的任何地方都没有使用 session 时,调用不会被阻止。在页面级别对 session 的任何读取或写入都会阻止页面方法调用。
问题:在 @Page
指令中设置 EnableSessionState=ReadOnly
是非常严格的,不想采用这种方式。
pagemethod调用可以不阻塞吗?并仍然访问 session ? (可能不是写而是读)
最佳答案
如果不实现自己的 session 提供程序,我认为您无法做到这一点。有 some info on this MSDN page .
ASP.NET applications are inherently multithreaded. Because requests that arrive in parallel are processed on concurrent threads drawn from a thread pool, it's possible that two or more requests targeting the same session will execute at the same time. (The classic example is when a page contains two frames, each targeting a different ASPX in the same application, causing the browser to submit overlapping requests for the two pages.) To avoid data collisions and erratic behavior, the provider "locks" the session when it begins processing the first request, causing other requests targeting the same session to wait for the lock to come free.
Because there's no harm in allowing concurrent requests to perform overlapping reads, the lock is typically implemented as a reader/writer lock-that is, one that allows any number of threads to read a session but that prevents overlapping reads and writes as well as overlapping writes.
关于c# - PageMethods 和 session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5110001/
我正在设置 PageMethods 以使用 javascript 访问服务器端代码。当我使用 firebug 进行调试时,我收到错误“PageMethods 未定义”。服务器端代码也没有被触发。 我已
我有以下方法背后的代码,我想使用 JScript 调用它 VB代码 Public Shared Function SayHello() As String Return
此代码从后面的代码中的公共(public)静态字符串获取返回值,并显示警报中返回的内容。 function GetFromServer() { PageMethods.GetHello(OnGetH
我正在尝试获取此 ASP.NET 函数的值: [ScriptMethod, WebMethod] public static bool checkRefresh() { return isCh
您好,我们使用 jquery 发送 ajax 请求,但它每次都会返回页面的内容。我们正在使用 .NET Framework 版本 2 $.ajax({ type: "POST", url: "ajax
我遇到了一个问题,我似乎无法找到以下解决方案: 我有一个包含菜单的母版页,菜单中的每个链接都是一个 LinkButton。 我需要每当用户单击某个链接以显示登录弹出窗口时,我使用了 Ajax Mo
我的页面上有很多页面方法。每种方法都用于从数据库中获取数据。我按照以下方式订购了它们。但我的问题是成功方法之外但主函数内部的行在页面方法完成该过程之前正在工作 function check_valid
以下是我对服务器端方法调用 PageMethod 的实现。它当前正在生成此错误消息“未捕获的 ReferenceError:PageMethod 未定义”。我可以在 Chrome Javascript
我有一个带有 MasterPage 的页面,在母版页中,我有这个: 我在后面的代码中有这个方法: [WebMethod] public void SavePreference(string gra
我有一个非常简单的 PageMethod 调用。当我单步执行 .cs 文件中的 PageMethod 时,该值看起来符合预期。但是,在客户端,我得到一个未定义的结果。有任何想法吗?这应该非常简单。 这
我正在做一个网站,用户可以在其中回复主题、打开主题等,当用户发送消息时,我不想回发;它很丑。 我现在正在使用通用处理程序,但我遇到了一些问题。就像在 XMLHttpRequest 的 onreadys
我正在尝试“AJAX 化”我的网站以改善 UI 体验。在性能方面,我也在尝试摆脱 UpdatePanel。我在 Encosia 上看到了一篇很棒的文章显示使用 PageMethods 发布的方式。我的
我正处于使用 Jquery 开发网站的早期阶段。我想知道是否使用 Pagemethods 还是 WCF 服务类。我在一个 SO 答案中看到,它说在未来的所有需求中尽可能使用 WCF。如果有人能解释什么
我有一个对 C# WebMethod 的 javascript 调用。同一页面有另一个调用,并且正在运行。我调试了 javascript 代码,这叫做: function userUpdReq_onO
我到处搜索这个解决方案。任何见解将不胜感激。 情况:当在单个页面中有多个 PageMethod 调用时,每个方法调用都持有 Session 对象的锁,从而阻塞。只有当 @Page 指令变为 False
我正在尝试使用 PageMethods 从服务器端调用一个函数,但我收到一个错误,指出 PageMethods 未定义。 这是我在 html 中添加的内容 这是后面代码中的函
编辑:帖子底部的最新信息。 我在使用 __doPostBack 强制回发的页面上有一个更新面板。 当我在 /path/page.aspx 浏览它时一切正常。 但是,一旦我通过像 /otherpath/
我编写了一个 JavaScript 函数,当用户在 RadConfirm 对话框中单击“确定”时会触发该函数。这应该会触发服务器的 JavaScript 回调,以从数据库中删除记录。这可能不是最好的架
我读过类似问题的几个答案,但没有一个回答我的问题。我已经尝试了我能想到的一切。我的代码如下所示: function onSuccess() { alert("succe
我正在开发一个 ASP.Net 应用程序,在使用 JavaScript 调用后台代码中的函数时遇到了一些麻烦。 这是我尝试运行的 JavaScript 函数: PageMethods.EditReco
我是一名优秀的程序员,十分优秀!