微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

asp.net – 什么是部分回发?

我是一个经验丰富的网页开发人员在几个不同的网络技术堆栈.我现在在.Net工作,我对部分回发变得好奇.

我明白Partial Postback的功能是什么,以及如何以编程方式使用它,但是我不喜欢使用我不明白的技术,那么Partial Postback如何实现.

我了解HTTP请求和异步请求,有关部分回发错误的事情是,它似乎是两者.

也许我只是错过了一些东西,但是在我看来,部分请求同时执行,首先触发异步POST请求,但是浏览器似乎知道,活动指示符开始旋转,这通常只发生在HTTP请求页面渲染.

任何人都可以看出微软如何在HTTP请求级别实施部分回发?

解决方法

How to write your own partial postback in ASP.NET 2.0

At the heart of the partial post back construction is the XMLHttpRequest,a DOM API. It can be used inside a web browser scripting language,such as JavaScript,to send an HTTP request directly to a web server without having to reload the entire page and handling the response from the server again within the scripting language. This data,in the form of XML,can then be used to manipulate the page elements on the client side.

When the button on the ASPX page has been clicked,a client side HTTP request is made using the XMLHttpRequest API. This request is handled by an HttpHandler on the web server. The HttpHandler receives the request,processes it,and sends back the response to the XMLHttp object on the ASPX page. The XMLHttp object in turn consumes the response and renders the appropriate UI changes without the browser having to do a full refresh of the page.

UpdatePanel不仅刷新它所包含的控件,还可以在处理完成后从服务器获取的ViewState值更新.

原文地址:https://www.jb51.cc/aspnet/249797.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐