$("[id$=_btnPostReminder]").click(function(){
var a = $find("<%=Editor1.ClientID%>");
var remindertext = a.get_content();
var re=$("#<%=hiddReminderTicketId.ClientID%>").text();
var res= $("#<%=txtReminderon.ClientID%>").val();
$.ajax({
type: "POST",
url: "AllTickets.aspx/btnPostReminder",
data: '{TicketId: ' + re + ',remindertext: ' + remindertext + ',reminderon: ' + res + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success:
function Ret(response) {
var Result=response.d
alert(Result)
$("#<%=txtReminderon.ClientID%>").val("")
$('#<%=hiddReminderTicketId.ClientID %>').text("")
$('#<%=lblAlert.ClientID %>').text("Set Successfully");
return false;
},
error: function(data, status, jqXHR) {
alert(jqXHR);
}
});
return false;
});
C# コードビハインド:
[System.Web.Services.WebMethod()]
public static string btnPostReminder(Int64 TicketId, string remindertext, string reminderon)
{
Common objCommon = new Common();
DAL objDal = new DAL();
SqlParameter[] para = new SqlParameter[4];
para[0] = new SqlParameter("@ticketid", DbType.Int64);
para[0].Value = TicketId;
para[1] = new SqlParameter("@REMINDERTEXT", DbType.String);
para[1].Value = remindertext;
para[2] = new SqlParameter("@REMINDERON", DbType.DateTime);
para[2].Value = objCommon.ReturnDate(reminderon);
para[3] = new SqlParameter("@CREATEDBY", DbType.Int64);
para[3].Value = Convert.ToInt64(1);
objDal.ExecuteSP("CREATE_REMINDER", para);
return " successfully";
}