0

我正在尝试将 ajax 发布到 aspx 页面。如何读取变量“myVar”?在下面的代码中 HttpContext.Current.Request("myVar")什么也没带回来

var p = { "myVar": JSON.stringify(tableOBJ) };

$.ajax({
    type: "POST",
    url: "Default2AJAX.aspx",
    data: p,
    success: function (data) {

    }
});

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
4

1 回答 1

2

我认为应该是

HttpContext.Current.Request.Form("myVar")
于 2012-08-07T19:08:09.110 回答