gpt4 book ai didi

asp.net - Page.IsPostBack 和 Page.IsCallBack 有什么区别?

转载 作者:行者123 更新时间:2023-12-02 04:14:44 24 4
gpt4 key购买 nike

我最近遇到了一些检查 Page.IsCallBack 的代码,但我不确定它与 Page.IsPostBack 有何不同。谁能帮我解答一下吗?

编辑:它们是相互排斥的还是在给定情况下可以同时发生?

最佳答案

Page.IsCallBack

It is getting a value indicating whether the page request is the result of a call back. Its a special postback, so a round-trip always occurs; however, unlike the classic postback, the script callback doesn't redraw the whole page. ViewState is not updated during a callback, it is for postback.

Page.IsPostBack

Checks whether the Page is accessing the server for the first time or not. Unlike the IsCallBack, the ViewState is updated

引用Page Life Cycle有关显示说明事件序列的图表的更多详细信息

编辑 -回答您的新问题

Page.IsPostback property will return true for both request types. The Page.IsCallback property will return true only when the request is a client callback

关于asp.net - Page.IsPostBack 和 Page.IsCallBack 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/760912/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com