Hi
I have below modal in User Control. How in the calling program it will be handled whether user has pressed Delete Button / Cancel Button
Thanks
Hi
I have below modal in User Control. How in the calling program it will be handled whether 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.
Hanif HefazPosted Aug 25, 2024, 8:19 AM
Expose the click events in user control and subscribe to these events in the parent web form.
Let me add the coding hints...
And now subscribe in the web form:
Ramco RamcoPosted Aug 25, 2024, 7:34 AM
Hi Hanif
Modal is a user control. Suppose i am calling this modal form from Department Webform. How i will handle Delete/Cancel click option
Thanks
Hanif HefazPosted Aug 25, 2024, 5:58 AM
Hello Ramco,
To handle the suituation for the delete or cancel button, In the code-behind of the calling program, you can use the Page_Load or Page_Init event to register event handlers for the modal's buttons. For the "Delete" button, you can use the lnkRecordDelete_Click event handler that you have already defined in your user control, and for the "Cancel" button, you can use the data-dismiss="modal" attribute, which will automatically close the modal when clicked.
Try this and reach me in case of any problem.