我明白Partial Postback的功能是什么,以及如何以编程方式使用它,但是我不喜欢使用我不明白的技术,那么Partial Postback如何实现.
我了解HTTP请求和异步请求,有关部分回发错误的事情是,它似乎是两者.
也许我只是错过了一些东西,但是在我看来,部分请求同时执行,首先触发异步POST请求,但是浏览器似乎知道,活动指示符开始旋转,这通常只发生在HTTP请求页面渲染.
任何人都可以看出微软如何在HTTP请求级别实施部分回发?
解决方法
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值更新.