Custom WEB Server Control ConfirmButton with Confirmation Dialog

xiaoxiao2021-03-06  45

Custom WEB Server Control ConfirmButton with Confirmation Dialog

I often see a problem like this in the forum: "How to pop up a confirmation delete dialog when you click the Delete button.

Below we come from yourself writing a custom web server control!

The idea is as follows:

Inherit System.Web.ui.WebControls.Button control

Add a property "confirmMessage" to indicate the prompt information above the pop-up confirmation.

Write a JavaScript to the page before the server control is presented before the page.

The content is as follows: