First of all I should mention that I spend whole day on searching and can't figure out whats wrong with my code and why it doesn't work ...
I need a modal dialog for confirmation in my code , so I use this jQuery modal dialog : JQuery Confirm
What I need is to embed this functionality with a <asp:Button>
...
My problem is that when I click on the button the dialog popup but the yes/no buttons doesn't work and both just disappear the dialog.
Also I use code below but __doPostBack()
didn't do anything at all but it runs simple js codes like alert('') perfectly:
$("#complexConfirm").confirm({
title: "Redirect confirmation",
text: "This is very dangerous, you shouldn't do it! Are you really really sure?",
confirm: function (button) {
__doPostBack('complexConfirm', 'OnClick');
},
cancel: function (button) {
return false;
},
confirmButton: "Yes",
cancelButton: "No"
});
I search and dialog cause element comes outside of the form element so I should bring it back to the form but I don't know how I try below code and it doesn't
$("#editEventModal").parent().appendTo(jQuery("form:first"));
Another probelm is I try to postback with javascript event without the dialog box, I use 2 button one for calling javascript and another for calling that , but when I use __doPostBack it refresh the page but doesn't comes to my button event in the code-behind, I try several ways to calling button onClick event but it just refresh the page and doesn't call my butoon OnClick Mehtod !!!
The buttons declaration are like this :
<asp:Button ID="complexConfirm" ClientIDMode="Static" runat="server" OnClick="TestBTN_Click" Text="Test" />
<asp:Button ID="checkit" ClientIDMode="Static" runat="server" OnClientClick="__doPostBack('<%=complexConfirm.UniqueID%>', '');" Text="CHECK" />
What should I do for these two problems ?
I search a lot and non of the solutions worked for me !!!
I will appreciate any solution, thank you.