you can use __doPostBack method
function functionName()
{
__doPostBack('ButtonId','OnClick');
}
or you can try this ....
<button id="btnsave" onclick="callfunction()">Save</button>// to all javascript
<asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" style="display:none" />
<script type="text/javascript">
function callfunction()
{
document.getElementById('<%= btnSave.ClientID %>').click();
}
</script>
WebMethod AJAX, asp- WebMethod.
$.ajax({
type: "POST",
url: "AspDotNetPage{}'{"+myData+"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
alert(msg);
}
});