简体   繁体   中英

postback event and control-change event in ASP.NET

I'ma a beginner in ASP.NET, just a question on event sequence on postback event and control event. Lets'say I have a button to submit a form and a dropdown on the form. So I selected sth to change the selected index first and then click the button, on the server, which event handler gets executed first? the button's click event handler or the dropdown's selectIndexChanged event handler?

You can enable Tracing to see order of event handling. More information at : https://blogs.msdn.microsoft.com/webdevelopertips/2009/06/11/tip-77-did-you-know-how-to-enable-page-level-tracing-for-your-asp-net-pages/

Also, if AutoPostBack is set to true on dropdown, then it will immediately post back when clicked.

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