asp.net-ajaxpostbackajaxcontroltoolkitmodalpopupextender

Make postback when the OkButton in a ModalPopup is clicked in ASP.NET AJAX


I follow the example in Atlas: Creating a Confirmation Using the ModalPopup Extender to make a postback when the OkButton in a ModalPopup is clicked (it uses the ModalPopupExtender that comes in ASP.NET Ajax Control Toolkit), but as I can see, the Sys.WebForms.PostBackAction() is no longer present in ASP.NET AJAX (the example is for Atlas). When I run it the "Microsoft JScript runtime error: Object expected" error message raises, in the line in javascript where I create the PostBackAction. How can I make this works in ASP.NET AJAX, or maybe, there's another way to do it? Thanks


Solution

  • Have you thought about using the ConfirmButtonExtender? You get the modal "bling" through the extender, and you'll have the PostBack processing you need.

    You wire the button click event as normal for processing, but the Confirm extender will "intercept" the processing and allow things to continue if the user confirms the action.