How to use ajax(Page Method) by using jquery
<script type="text/javascript">
function ChangeStatusOrder(ID, action,confirmationType ) {
$.ajax({
type: "POST",
url: "TransactionStatusMaster.aspx/UpdateCurrentOrder" ,
data: "{id:" + ID + ",action:" + action + ",confirmation:'" + confirmationType + "'}" ,
contentType: "application/json; charset=utf-8" ,
dataType: "json",
success: function (msg) {
// Do something interesting here.
}
});
}
</script >
TransactionStatusMaster.aspx
==============================
<img src="../../Assets/Images/arrow_up.png" onclick="ChangeStatusOrder(<% #Eval("ID") %>,0,'<% #Eval("ASGroup") %>')"
alt="Move Up" style="cursor : pointer;" />
TransactionStatusMaster.aspx.cs:
================================
[System.Web.Services. WebMethod]
public static string UpdateCurrentOrder( int id,int action,string confirmation)
{
//perform your action here
return "your success message";
}
No comments:
Post a Comment