0

我必须使用POST方法从 aspx 发送 XML 数据并在另一个 Aspx 文件中接收参数。

我已将 XML 数据存储在xmlValidator命名的 Javascript 变量中。我尝试使用以下代码,但它对我不起作用:

为了发送,我写道:validator.aspx

<script type = "text/javascript">
    function submit_a() {
        $.post("../All.aspx", { "data": validatorXML }, function (result) {
         alert(result);
        });
 }
</script>

在接收点,即在All.aspx 我写的页面中:(从博客中阅读)

<%@ Page Language="C#" AutoEventWireup="true" %>
 <%
   NameValueCollection nvc = Request.Form;
     Response.Write(nvc["data"]); //Here i have to call a method written in a .cs file
  // which return some data and print in `validator.aspx`
%>

但它什么也没打印。问题是什么?

4

1 回答 1

0

阅读。

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx

于 2012-08-21T21:16:44.660 回答