Page_Load after modal popup

I have a page with a user control that gets some data updated with a modal popup. After clicking β€œok” on the modal pop-up menu, new data is written to the database, but the base page does not β€œreload” to show updated data. How can I achieve this?

+4
source share
3 answers

1) Do not set the OKControlID property in ModalPopupExtender.
2) In your Page_Load set OkButton.OnClientClick = string.Format("$find('{0}').hide();", modalPopupExtender1.ClientID);

Explanation: Setting OkControlID stops sending the button. Instead, manually use javascript to hide the expander, which will allow the button to publish the form.

0
source

You will have to either update this control with ajax, or just execute Response.Redirect (if your modal is -.net or document.location if js) return to your page after updating the data.

0
source

Make sure the OK button in your modal popup causes a postback. If you want ajax to enable it, be sure to place it inside the update panel.

0
source

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


All Articles