I want to discuss the order of execution between a JavaScript function and a C# method:
Here is the code for a button in HTML:
<asp:Button ID="MyBut" runat="server" OnClick="MyBut_Click" CssClass="MyBut" />
In C#:
protected void MyBut_Click(object sender, EventArgs e)
{....}
And in JavaScript:
$(document).ready(function () {
$(".MyBut").click(function () { alert("!"); });
})
Currently, the JS function is executed first followed by the C# method. Is it possible to have the C# method execute before the JS function?