我想讀取Aspx頁面中Sencha Touch 2的POST參數。從Sencha Touch 2讀取Asp.net中的POST參數
Aspx從Sencha Touch Framework(由移動應用程序團隊)按以下方式調用。
Ext.Ajax.request({
url:'http://bookingsite.com/flight/Secure_Payment.aspx',
method:'POST',
disableCaching: false,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
jsonData: {
uniqueID:"24608b55-3f69-4814-9de3-ebc88fa95700",
totalFare:"3500"
},
success:function(response)
{
console.log(response.responseText);
}
failure:function(response)
{
console.log(response);
}});
煎茶觸摸的POST參數是通過在Asp.net(Secure_Payment.aspx)通過以下方式
protected void Page_Load(object sender, EventArgs e)
{
// Tried by the following ways.
string uniID = HttpContext.Current.Request.Form["uniqueID"];
string uniID = HttpContext.Current.Request["uniqueID"];
string uniID = HttpContext.Current.Request.Form.Get("uniqueID");
if (!string.IsNullOrEmpty(uniID))
{
ds = balLayer.GetEBSPaymentParams("uniID");
}
tripID=ds.Rows[0]["TripID"].ToString();
name = ds.Rows[0]["ContactFname"].ToString();
}
讀到這裏,數據集總是返回空值。
請通知我如何閱讀Aspx頁面中的POST參數。
你要反序列化Request.InputStream。請參閱http://stackoverflow.com/questions/3398926/how-to-retrieve-json-via-asp-net-context-request – sjkm
@sjkm感謝您的信息。我會盡力而爲。 – Thiri