How to display different AJAX update panels in one place in ASP.NET?

I have a page with 5 buttons at the top. I want the area under the buttons to contain the update panel, on which button panel 1 will be displayed if they press button 1. If they press button 2, then I want the button 2 update panel to replace the button 1 update panel. On each panel there are things like checkboxes and text boxes.

Is there any way to do this? Is there a more efficient way to do this?

+4
source share
2 answers

Simple, my friend .. I just have one update panel with several asp: Panel or asp: PlaceHolders inside. All of them should be visible, except those that should be displayed based on the clicked button.

If your buttons are inside the UpdatePanel, you're done. If they are outside - no problem! Add AsyncPostBackHandlers to the UpdatePanel by pointing to these buttons. Although the buttons are not in the UpdatePanel, they will still generate an AJAX callback :)

You can give an example if you need it too!

+3
source

Source: https://habr.com/ru/post/1307320/


All Articles