我希望在我的c#.net应用程序中读取以JSON格式发布的数据?我对JSON和POST方法非常陌生?
有人能帮帮我吗? 我正在从页面1发布数据。为了测试目的,将其发送到其他页面2(在我的情况下是smsstaus.aspx)。 我想在Page2的PageLoad中读取已发布的JSON数据。
示例代码.....
function SendSMSStatus() {
$.ajax({
type: "POST",
url: "myurl/smsstatus.aspx",
data: '{"SmsSid":"' + $("#<%= txtSmsSid.ClientID%>").val() + '","SmsStaus":"' + $("#<%= txtSmsStaus.ClientID%>").val() + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
alert('update the db here');
},
error: function () { }
});
}