Ajax UpdatePanel如何只刷新页面的特定部分
我在 ASP.NET 的 SSE 职位面试中遇到了这个问题。面试问我,当您单击按钮时,使用哪个控件不会刷新整个页面。我回答说我们使用 Ajax updatepanel 来实现。然后他要求解释一下 updatepanel 是如何做到这一点的。
I got this question in Interview for post of SSE in ASP.NET. the interview asked me that which control u use to not get your full page refresh when u click on button. i answered that we use Ajax updatepanel for it. then he asked that explain that how does updatepanel do it happen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为更新面板会挂钩提交事件并生成异步请求。它通过作为 HTTPModule 的 System.Web.Handlers.ScriptModule 来管理请求/响应。该模块作用于由UpdatePanel引起的异步请求。它呈现更新面板并将结果写入最后的响应。查看这篇文章。这并不是更新面板的确切作用。但演示了如何使用 HTTPModule 来更新页面的一部分、ViewState 和 EventValidation(如 UpdatePanel)。
http://mgolchin.blogspot.com/2009/ 09/custom-control-with-partial-rendering.html
I think an update panel hooks the submit event and generates an asynchronous request instead. It manages the request/response by
System.Web.Handlers.ScriptModule
that is an HTTPModule. This module acts on the asyc request which are caused by UpdatePanel. It renders the update panel and writes the result to the response at the end. Check this post out. It's not what exactly an update panel does. But demonstrates how you can use an HTTPModule to update a portion of a page, ViewState and EventValidation like an UpdatePanel.http://mgolchin.blogspot.com/2009/09/custom-control-with-partial-rendering.html