postback and callback
postback:
In the default model for ASP.NET Web pages, the user interacts with a page and clicks a button or performs some other action that results in a postback. The page and its controls are re-created, the page code runs on the server, and a new version of the page is rendered to the browser.
callback:
In a client callback, a client script function sends a request to an ASP.NET Web page. The Web page runs a modified version of its normal life cycle — the page is initiated and its controls and other members are created, and then a specially marked method is invoked. The method performs the processing that you have coded and then returns a value to the browser that can be read by another client script function. Throughout this process, the page is live in the browser.
In the default model for ASP.NET Web pages, the user interacts with a page and clicks a button or performs some other action that results in a postback. The page and its controls are re-created, the page code runs on the server, and a new version of the page is rendered to the browser.
callback:
In a client callback, a client script function sends a request to an ASP.NET Web page. The Web page runs a modified version of its normal life cycle — the page is initiated and its controls and other members are created, and then a specially marked method is invoked. The method performs the processing that you have coded and then returns a value to the browser that can be read by another client script function. Throughout this process, the page is live in the browser.
2006-04-24 22:06 by 心只有你
@ James Chen
看了你的解答我清楚了很多,是不是IsPostBack为true时,页面有任何变化都需要重新生成,给人刷新的感觉。而IsCallBack为true时,感觉只是客户端脚本在运行,虽然页面有变化,但是没有刷新的感觉。不过写客户端脚本是真的是一件很繁人的事情!!!
你看过Atlas吗?那个框架提供了一大堆的控件来实现Ajax一样的感觉,是不是也用到了Page的IsCallBack?
看了你的解答我清楚了很多,是不是IsPostBack为true时,页面有任何变化都需要重新生成,给人刷新的感觉。而IsCallBack为true时,感觉只是客户端脚本在运行,虽然页面有变化,但是没有刷新的感觉。不过写客户端脚本是真的是一件很繁人的事情!!!
你看过Atlas吗?那个框架提供了一大堆的控件来实现Ajax一样的感觉,是不是也用到了Page的IsCallBack?
2006-04-24 22:34 by James Chen
你说的不错。PostBack方式刷新整个页面,CallBack方式不刷新整个页面。但是CallBack不能等同于Ajax,据说两者的实现原理不同。CallBack只能传送string类型的参数,而Ajax使用的是httprequest+xml的机制。Atlas我没看过,但它是实实在在的.NET环境下的Ajax库。没看的原因一是因为苏鹏的Ajax Webcast里还没讲到它,二是没听到它是否正式release了,呵呵。
原文链接:http://www.cnblogs.com/dkhero/archive/2006/04/19/379188.html
原文链接:http://www.cnblogs.com/dkhero/archive/2006/04/19/379188.html
posted on 2006-11-30 02:02 SDIce.Marshall.li 阅读(560) 评论(0) 收藏 举报