My aspx design is -
BackgroundCssClass="modalBackground" CancelControlID="btnCancel"/>
----------
Issue -
btnCancel_Click event is not firing.
When I run the portal... and click on "Cancel" button, the event is not getting fired...
Please help me out.. .I am not able to debug the issue...

Keertti Raj Thangavelu BabuRank #3,979 · 374 reputationPosted Apr 8, 2015, 4:29 AM EDT
use this code, if you pass cancel button id to cancelcontrolId you should not use onclick function that only for close the panel.
Add Document
BackgroundCssClass="modalBackground" CancelControlID="btnCancel"/>
---------------------------------------------------------------------------
Please accept and up vote if helped you
Khargesh RajputRank #616 · 3.9K reputationPosted Apr 8, 2015, 9:42 AM EDT
If you want to do something on btncancel then use.javascript
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 8, 2015, 8:53 PM EDT
I just have to do 2 small things in this modal popup...
When a file is uploaded , I have to fire an insert query (insert into table (task) value('File Uploaded')
When Cancel button is clicked, then insert "File uploading cancelled" in the database....
How to do this ?? I am able to insert - "File uploaded" in database... But... on cancel button, the event is not getting fired...
How to achieve this ??
Please guide...
If I have to use javascriot.. then how to call a method in java script ??
Please help !
Khargesh RajputRank #616 · 3.9K reputationPosted Apr 8, 2015, 9:07 PM EDT
then you have to write code on cancel button click to first delete data after that
modalpopup.hide();
Prafulla Choudhary123 reputationPosted Apr 8, 2015, 10:02 PM EDT
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 8, 2015, 10:11 PM EDT
This means...
I have to take one more button control, make it visible = false and then fire that button_click event ??
Please explain step-wise.
Is it that I have to take asp:Button and do this ??
Kindly let me know where I am going wrong ?
The CancelControlID - directly closes the popup...
saravanagopi s23 reputationPosted Apr 9, 2015, 2:57 AM EDT
is there any code to delete the record from table there in btncancel click event?
Khargesh RajputRank #616 · 3.9K reputationPosted Apr 9, 2015, 3:00 AM EDT
on btncacel
write code for delete data
after delete
modalpopupID.hide();// to close popup but it will postback your page
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 12, 2015, 2:38 AM EDT
Yes... There is an Insert Query written on the code-behind....
I removed the CancelTargetControlID Property... and then I debug the application..
This time, the event fired...
So..If I close the popup on this button (modalpopup1.Hide()), is this correct way of doing the code ??
Or am I going wrong somewhere ?