Server.Transfer的从ASP到ASP.Net

编程入门 行业动态 更新时间:2024-10-28 20:20:33
本文介绍了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","127.0.0.1/MyApp/NewXmlHandler.aspx",false xmlhttp.send(Request) Response.Write xmlhttp.responseText Set xmlhttp = nothing %>

更多推荐

Server.Transfer的从ASP到ASP.Net

本文发布于:2023-11-15 08:54:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1592970.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Transfer   Server   Net   ASP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!