从ASP页调用一个ASP.NET页面 [英] Calling an ASP.NET page from an ASP page

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

问题描述

我试图调用从传统的ASP页面的ASP.NET页面在同一台机器上。 ASP页位于c:\\的Inetpub \\ wwwroot文件。 ASP.NET页面位于C:\\的Inetpub \\ wwwroot的\\ WebServiceWrapper \\

I am attempting to call an ASP.NET page from a classic ASP page on the same machine. The ASP page is located in c:\inetpub\wwwroot. The ASP.NET page is located in C:\Inetpub\wwwroot\WebServiceWrapper\

下面是ASP code调用页面:

Here is the ASP code to call the page:

Dim objHttp, strQuery
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
strQuery = "http://localhost/WebServiceWrapper/CalledFromAsp.aspx?First=Steve&Last=Smith&DOB=11/25/2001&Gender=M"
objHttp.open "POST", strQuery, false
objHttp.send
Set objHttp = Nothing

在ASP.NET code,它调用Web服务,并设置一个cookie,如果我直接调用它从浏览器的工作原理。然而,使用Msxml2.ServerXMLHTTP对象,它没有。该cookie不产生,并且没有错误。有在事件查看器中没有任何事件。

The ASP.NET code, which calls a web service and sets a cookie, works if I call it from the browser directly. However, using the Msxml2.ServerXMLHTTP object, it does not. The cookie is not generated and there is no error. There are no events in Event Viewer.

ASP.NET页面是在Visual Studio 2005,.NET 2.0开发的。在POST更改为GET并没有帮助。

The ASP.NET page was developed in Visual Studio 2005, .NET 2.0. Changing the POST to a GET has not helped.

任何想法?

推荐答案

如果你正在尝试将用户重定向到ASP.NET页,使用Response.Redirect的。

If you are trying to redirect the user to the ASP.NET page, use Response.Redirect.

如果你只是想打电话给ASP.NET页面设置Cookie当用户访问你的ASP页面,你可以使用一个小的和不可见的iframe中。就在iframe的目标设定为ASP.NET页面。

If you just want to call the ASP.NET page to set the cookie when the user visits your ASP page, you can use an small and invisible iframe. Just set the iframe target to your ASP.NET page.

当然,你总是可以直接从你的ASP code调用web服务,并设置有饼干

Of course, you could always call the webservice directly from your ASP code and set the cookies there.

这篇关于从ASP页调用一个ASP.NET页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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