0

I want to execute a method from a server side. I am using ASP.NET WebForm. I am subscribed to a button click dynamically with jquery

$('input[value="execute"]').bind("click", myJavaScriptFunction);

I am not using this way

<asp:Button ID="btnSend" runat="server" CssClass="modalButton" Text="execute" OnClick="btnSend_Click" />

because I want to display a confirm dialog before the execution of the click event if OK button was pressed

var myJavaScriptFunction = function (e)
{
    if (window.confirm('Are you sure?')) {
        //HERE I WANT TO PERFORM A CALL TO btnSend_Click with null, null PARAMETERS
    }
}

Can I do the same behavior in a different way?

Mike Brind
  • 28,238
  • 6
  • 56
  • 88
Zinov
  • 3,817
  • 5
  • 36
  • 70
  • 1
    possible duplicate of [Call C# Function From JavaScript/JQuery In Asp.net webforms](http://stackoverflow.com/questions/7444483/call-c-sharp-function-from-javascript-jquery-in-asp-net-webforms) – jrummell Nov 10 '14 at 16:12
  • possible duplicate of [How to fire a button click event from JavaScript in ASP.NET](http://stackoverflow.com/questions/7646162/how-to-fire-a-button-click-event-from-javascript-in-asp-net) – Beast-a-tron Nov 10 '14 at 16:14

0 Answers0