[英]jquery ajax post to .aspx page load - how to read variable posted?
I am trying to do a ajax post to a aspx page . 我想在aspx页面上做一个ajax帖子。 How do I read the variable "myVar"?
如何读取变量“myVar”? in the code below
HttpContext.Current.Request("myVar")
brings back nothing 在下面的代码中
HttpContext.Current.Request("myVar")
没有带回任何东西
var p = { "myVar": JSON.stringify(tableOBJ) };
$.ajax({
type: "POST",
url: "Default2AJAX.aspx",
data: p,
success: function (data) {
}
});
Default2AJAX.aspx code behind Default2AJAX.aspx代码落后
Partial Class Default2AJAX
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim s As String = HttpContext.Current.Request("myVar") ''not working???????
End Sub
End Class
我认为应该是
HttpContext.Current.Request.Form("myVar")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.