请问谁有在ASP.NET1.x下实现页面异步调用的代码有的话请发到谢谢了大家了

解决方案 »

  1.   

    异步调用,可以用AJAX来实现.很简单
      

  2.   

    异步页!=ajax
    Asp.net1.1做这个很麻烦
      

  3.   

    是啊,哪位大大能给个1.X下的例子啊,不要Ajax的
      

  4.   

    web其实并无异不异步这么个概念,
      

  5.   

    AjaxPro.NET、wwHoverPanel等的,好象都支持1.x吧。搜索一下,你就能找到一堆,只有Callback和Atlas是规定要2.0的。Atlas的话,如果你仅仅用客户端框架,1.x也能用,甚至php也能用,因为它的客户端框架是好像Dojo那样的一个独立JavaScript库。
      

  6.   

    不是啊, 为什么非要用ajax相关技术呢?怎么会没有异步这个概念呢?大家都知道I/O、web服务和复杂的数据库都需要消耗相当的时间,而服务器端线程池中的工作线程也是有数量的,当进行一个复杂的数据库操作时工作线程会一直等到操作完毕才会返回到线程池中供下一个请求使用。这样是比较浪费的。使用异步调用可以使工作线程只做完他该作的事情就可以返回到线程池,而剩下的工作由我们自定义的线程来完成。这样就能使工作线程更好的被利用。不知道大家有没有在1.X下这样的例子啊??
      

  7.   

    哦……原来你不是指UI上异步调用服务器端的函数,而是指纯服务器端的异步调用。其实你自己知道原来的,无非就是用Thread。在当前HTTP线程外开一个新的Thread执行你要做的东西,然后当前HTPP线程还是按原本的模式结束,这不需要什么例子,按照普通Thread的用法去用就是了。特殊的情况,是例如定时执行的任务,这时候用到System.Threading.Timer,参考Community Server的Job设计。
      

  8.   

    http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/
    Summary:
    The trick here is to implement IHttpAsyncHandler in a page's codebehind class, prompting ASP.NET to process requests not by calling the page's IHttpHandler.ProcessRequest method, but by calling IHttpAsyncHandler.BeginProcessRequest instead. Your BeginProcessRequest implementation can then launch another thread. That thread calls base.ProcessRequest, causing the page to undergo its normal request-processing lifecycle (complete with events such as Load and Render) but on a non-threadpool thread. Meanwhile, BeginProcessRequest returns immediately after launching the new thread, allowing the thread that's executing BeginProcessRequest to return to the thread pool.
      

  9.   

    根据这里的说法,这种方式终归也不好,线程操作的一些通常技巧在asp.net环境下一般达不到预期效果,会带来一些问题,包括从线程池中盗取线程等.最好是写自定义的线程池来处理异步页的问题.
    参考链接:
    http://msdn.microsoft.com/msdnmag/issues/05/02/NETMatters/