Hi
I have below modal Popup User Control.
In WebForm Department.aspx how to handle user has pressed Delete Button / Cancel Button
Thanks
Hi
I have below modal Popup User Control.
In WebForm Department.aspx how to handle user has pressed Delete Button / Cancel Button
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Naimish MakwanaPosted Aug 27, 2024, 4:54 AM
To handle the actions when the user presses the Delete or Cancel button in your modal popup on the
Department.aspxWebForm, you can follow these steps:Department.aspx.cs), create an event handler for thelnkRecordDelete_Clickevent. This is where you will write the logic to delete the record.Handle the Cancel Button Click Event:
data-dismiss="modal"attribute, which will close the modal when clicked. No additional server-side code is needed for this action.Optional: Use a Hidden Field to Pass Data:
By following these steps, you can effectively handle the Delete and Cancel actions in your modal popup.
Thanks
Željko PerićPosted Aug 25, 2024, 7:15 PM
In your WebForm
Department.aspx, you can handle the button clicks for the "Delete" and "Cancel" actions as follows:1. Delete Button (
lnkRecordDelete) Handling:In the code-behind (
Department.aspx.cs), handle theOnClickevent for the delete button:2. Cancel Button Handling:
Since the Cancel button is a standard HTML button (
), and it has thedata-dismiss="modal"attribute, it will automatically close the modal when clicked. If you want to do something additional when the Cancel button is clicked, such as clearing form fields or resetting states, you can use JavaScript:The modal popup will close, and you can execute any necessary additional logic in the JavaScript function.
All the best, Željko Peric