简体   繁体   中英

asp.net disabling listbox on postback

I have a asp.net listbox. A master-detail view. When the selectionchanges on the listbox, controls on an update panel update. All working fine. Now if the user arrows through the listbox selections I get like a million postbacks. Ideally (for UX) it would be great to cancel the previous postback. But what I tried was on the PageRequestManager.add_initializeRequest: disable the listbox with jquery so the user cannot make another selection. Then on add_endRequest enable the listbox. The boss does not like the disabled look for a couple of seconds.

Can someone think of a better way for me to handle this? I tried changing the color while disabled but could not find a way.

Use Ajax ModalPopupExtender, you can show a progress bar or simply a spinner icon for informing the user that the server is busy doing his/her last operation. The ModalPopupExtender disable all page controls till finishing the operation.

This is the official control page. And this is an example from Matt Berseth, he uses it for editing but the concept is the same.

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