问题标签 [pageasynctask]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - PageAsyncTask 会触发自己的线程吗?
在 .aspx 页面中使用时,PageAsyncTask 是否会触发自己的线程?
asp.net - ASP.NET 链式异步调用
我有一个 ASP.NET 页面,它需要调用多个 Web 服务以返回数据。我想并行运行这些请求,并且使用 PageAsyncTask 类似乎是最合适的方法。诀窍是有五个跟注——比如 A、B、C、D 和 E。跟注 A 和 B 必须按顺序进行,C 和 D 也必须如此。AB 对、CD 对和 E 都可以运行在平行下。
看来我不能使用 PageAsyncTask 构造函数的“executeInParallel”参数来创建 5 个任务并获得这种并行/顺序的配置。
我尝试创建 3 个任务,其中两个链接了异步调用(类似于http://msdn.microsoft.com/en-us/library/dwba7yy7(VS.80).aspx)。当我尝试在 PageAsyncTask 的上下文中执行此操作时,我收到一个错误,指示只能调用一次结束函数。我尝试将 3 个函数的链式集合包装在 PageAsyncTask 使用的一对函数中,这导致最终函数永远不会被调用(因此超时)。
有没有好的方法来做到这一点?
编辑:如果它有用,这是我正在尝试的代码的简化版本,并得到了 end 函数只能被调用一次的错误。
android - PageAsyncTask endHandler 更新调用页面
我被迫应用 Microsoft 的 PageAsyncTask 对象,这是我的新手(在我一直使用 jQuery AJAX 调用之前)。除了工作完成并调用 endHandler 外,我的一切工作正常,我如何让调用页面更新其内容?
基本上,我的异步函数运行大量数据库操作,并使用 HTML 向调用者报告数据库运行的结果。操作完成后,我想在调用页面上显示这些结果。除了显示结果的调用页面外,我一切正常。
感谢您的帮助。
asp.net - PageAsyncTask Not Running in Parallel
I am examining async web pages async="True"
. In Page_Load, I am registering 3 tasks using RegisterAsyncTask. Each of these tasks is calling a SQL Server stored procedure. The stored procedure is doing a simple select and waiting for a couple of seconds using WAITFOR DELAY '00:00:02'
My problem is that the pages takes 6 seconds to get back to me instead of just 2 seconds.
This is the trace of the page.
Any ideas/suggestions?c# - PageAsyncTask and HttpContext
I am using the PageAsyncTask object to execute some elements in parallel on a standard ASP.NET page. However I need one task to have access to Http Session. Is there a way to get the Http Session passed to the PageAsyncTask?
c# - PageAsyncTask 时间和顺序流程一样吗?
为什么以下使用 PageAsyncTask 的 ASP.NET 代码总共执行 8 秒,无论我是按原样运行它还是我用 PageAsyncTask 注释 2 行并在 Page_load 中取消注释 Thread.Sleep(5000)?:
//PageAsyncTask asyncTask1 = new PageAsyncTask(BeginAsyncOperation,
EndAsyncOperation,
OperationTimeOut, arr, true);
//Page.RegisterAsyncTask(asyncTask1);
Thread.Sleep(5000);
我知道 PageAsyncTask 与其他任务并行运行一个任务,并且在这种情况下应该使页面加载的整个过程更快。我错过了什么?
asp.net - 页面 RegisterAsyncTask 服务器奇怪的行为
当前上下文:我们有一个需要并行加载多个列表的网页,我们决定使用 Page.RegisterAsyncTask 来执行此操作(一旦我们调用 Page.ExecuteRegisteredAsyncTasks(),这些方法只是加载数据,将被渲染作为渲染的 JSON,并且页面的 Async 属性设置为 true - 所以一切都应该没问题)在我们的开发机器(win 7 和 win 8)上,性能从 3 秒大幅提高到 1 秒以下。
问题:一旦部署在登台/实时服务器 (Windows 2008 R2) 上,与非异步标准版本相比,性能没有任何改进。
尝试了其他解决方案:我们尝试在不同线程上的 PageLoad 上使用 Task.Factory.StartNew + Task.WaitAll 加载任务,并且在开发机器和登台机器上存在相同的行为。尝试在登台服务器上更改 machine.config 中的设置(尽管尚未完成重新启动)()
问题:有没有人遇到过这个问题,如果有,您是否找到了解决方案?是不是Win7/8和Windows 2008 R2的线程调度算法不同造成的
c# - PageAsyncTask 更新 UI
我正在学习 ASP .NET 中的异步操作。我在这里找到了一篇文章MSDN。该代码有效,但我希望能够在漫长的过程中更新 UI。它仅在过程完成后显示结果。我对 AsyncClass 使用与提到的链接中相同的代码。这是代码:
c# - asp.net PageAsyncTask 没有异步运行
我有一个 PageAsyncTask 需要大约 2 分钟才能运行。我的页面指令有 Async="true",我的配置有 180 的超时时间(3 分钟给额外的时间),但是当我调用 Page.ExecuteRegisteredAsyncTasks() 时它不会立即返回并且在运行时阻塞任务。
我错过了让它异步运行的任何步骤吗?
(这个格式更好,但编辑后它搞砸了)
c# - 响应永远不会以 PageAsyncTask 结束?
我必须支持一个PageAsyncTask
与 webforms vs2010 fw4 一起使用的旧项目。
然而,这个简单的代码确实编译 + 执行(在调试模式/跟踪模式下没有错误),但响应永远不会结束。
查看调试模式 + 断点 - 它到达代码的所有阶段。
问题
响应永远不会结束。我所看到的是:
我错过了什么?
(nbAsync="true"
在页面指令上,也 - 代码被简化只是为了描述这种情况)