ASP中的数据丢失到MVC

时间:2018-02-15 18:44:49

标签: asp.net-mvc post

我有一个ASP页面:

<%
sData = "VARIABLE=SOMEDATAHERE"
oHttpRequest.Open "POST", "http://????/AAA/BBB", False
oHttpRequest.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oHttpRequest.Send sData

oPostResponse = oHttpRequest.ResponseText

Response.Write oPostResponse
%>

我将其发布到MVC网站:

[HttpPost]
public ActionResult BBB(string PORTAL)
{
}

在我的BBB功能中,我无法进入SOMEDATAHERE。

我试过了:

Request.Form["VARIABLE"]
Request.ServerVariables["VARIABLE"]

我尝试使用下面的代码阅读原始流,但那也是空白的.. 我不确定我还能尝试什么?

        System.IO.Stream str; String strmContents;
        Int32 counter, strLen, strRead;
        // Create a Stream object.
        str = Request.InputStream;
        // Find number of bytes in stream.
        strLen = Convert.ToInt32(str.Length);
        // Create a byte array.
        byte[] strArr = new byte[strLen];
        // Read stream into byte array.
        strRead = str.Read(strArr, 0, strLen);

        // Convert byte array to a text string.
        strmContents = "";
        for (counter = 0; counter < strLen; counter++)
        {
            strmContents = strmContents + strArr[counter].ToString();
        }

0 个答案:

没有答案