简体   繁体   English

ICallBackEventHandler和HTTPHandler有什么区别?

[英]What is the difference between ICallBackEventHandler and HTTPHandler?

When we write our own custom HTTPHandlers aren't they behave the same way as ICallBackEventHanlder does? 当我们编写自己的自定义HTTPHandler时,它们的行为是否与ICallBackEventHanlder的行为相同? we use both to make ajax calls from our web page, isn't this correct? 我们都使用这两者来从我们的网页进行Ajax调用,这不正确吗? or my understanding wrong, I wont doubt if it is :( 或我的理解是错误的,我不会怀疑它是否是:(

Obviously HTTPHandlers are more broader concept since a web page (.aspx) etc are also http handlers. 显然,HTTPHandlers是更广泛的概念,因为网页(.aspx)等也是http处理程序。

A ICallBackEventHandler is for integration with a page -- a handler is for anything. ICallBackEventHandler用于与页面集成-处理程序适用于任何内容。 A callback handler is useful when you want to do an ajax request from the client-side of a page, and from that handler you still want access to all of the controls on the page, their re-saturated state that comes from ViewState, etc. An http handler has no access to the page or its state. 当您想从页面的客户端发出ajax请求时,回调处理程序非常有用,并且您仍然希望从该处理程序访问页面上的所有控件,其来自ViewState的重新饱和状态等。 。http处理程序无权访问该页面或其状态。 A callback handler can also push some state changes back to the client. 回调处理程序还可以将某些状态更改推回客户端。 For example, a callback handler might render something which requires the __EVENTVALIDATION field on the client-side to be updated. 例如,回调处理程序可能会呈现需要更新客户端上的__EVENTVALIDATION字段的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM