简体   繁体   中英

In asp.net, how can I tell what triggered an additional page_load call?

Greetings.

Is there a good way to determine what is calling my Page_Load method? I've got a few Componentart WebUI grids that call it, although I've checked all of those (using the gridName.IsCallback property). I've also got an update panel, but I'm not sure how to check if it is the caller.

I'm betting there is a property somewhere that will tell me.

Thanks!

我不确定程序是否可以在运行时检查属性,但是如果您在断点处放置一个对象,然后在Visual Studio中检查堆栈,则可能会为您提供足够的信息来确定它的来源。

Request.Form [“ __ EVENTTARGET”]可能可以解决问题,它包含除触发回发的常规按钮(按钮触发“正常”回发)以外的任何控件的ID。

可能导致此问题的原因是控件的AutoPostBack属性只需检查您在页面上拥有的控件,然后查看哪个控件设置了该属性即可。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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