Server.Transfer的从ASP到ASP.Net [英] Server.Transfer from ASP to ASP.Net

查看:201
本文介绍了Server.Transfer的从ASP到ASP.Net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的情况:

一个桌面应用程序的帖子到一个特定的ASP页面中使用XML数据我的Web应用程序。 Web应用程序正在被重新写入ASP.Net;然而,对于特定页面的URL不能改变(由于桌面应用程序)。

A desktop application posts to a specific ASP page in my web application with XML data. The web application is being re-written to ASP.Net; however, the Url for that specific page can not change (due to the desktop application).

我最初的想法是简单的前进从传统的ASP页面请求到一个新的ASPX页面,这将处理请求,通过改变ASP页,像这样:

My original idea was to simply 'forward' the requests from the classic ASP page to a new ASPX page, which would handle the request, by changing the ASP page like so:

<% Server.Transfer("MyApp/NewXmlHandler.aspx") %>

但是,这并不工作:​​

However, this doesn't work:

Active Server Pages的错误'ASP 0221'
  无效的@命令指令
  /MyApp/NewXmlHandler.aspx,1号线

Active Server Pages error 'ASP 0221' Invalid @ Command directive /MyApp/NewXmlHandler.aspx, line 1

有没有我可以在ASP页发布的数据,并将它转发到另一个页面的简单方法?

Is there a simple way I can take the posted data in the ASP page, and forward it on to another page?

谢谢!

推荐答案

在情况下,任何人都跑成这样,我结束了传递沿线像这样的要求:

In case anyone else runs into this, I ended up passing the request along like so:

<%
    Dim postData
    Dim xmlhttp 

    'Forward the request to let .Net handle
    Set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP")
    xmlhttp.Open "POST","http://127.0.0.1/MyApp/NewXmlHandler.aspx",false

    xmlhttp.send(Request)

    Response.Write xmlhttp.responseText

    Set xmlhttp = nothing
%>

这篇关于Server.Transfer的从ASP到ASP.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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