如何发送和接收asp.net POST请求? [英] How to send and receive the POST request in asp.net?

查看:228
本文介绍了如何发送和接收asp.net POST请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要送 XML ASPX 使用 POST 方法和接收另一个aspx文件中的参数。

I have to send the xml data from aspx using POST method and receive the parameters in another Aspx file.

我已存储在 xmlValidator XML数据命名的JavaScript变量。我试着用下面的code,但它并没有为我工作:

I have stored the xml data in xmlValidator named javascript variable. I tried with the following code but it didn't work for me:

有关发送我写道: validator.aspx

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

和在接收点,即在 All.aspx 页我说:(从博客读)

And at the receiving point i.e. in All.aspx page i wrote: (read from blog)

<%@ 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`
%>

但它打印什么。有什么问题?

But it prints nothing. What is the problem?

推荐答案

阅读。

http://msdn.microsoft.com/en-美国/库/ system.net.httpwebrequest.aspx

这篇关于如何发送和接收asp.net POST请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆