Redirect .ASP page to .ASPX page using Server.Transfer.

Hi,
Our environment currently is running ASP page to pass a querystring to the Web Server. The client side is using a windows application to send the data (example):
https://webserver1.com/MSG.asp?ClientSendingTheMessageString

The Server application (written on VB6) that receives the message will read the querystring content to perform some actions.

We have converted our Server application to .NET. Thus, we understand that the .aspx page is required.

What we want to do is to perform redirection from .asp page to .aspx page for our server application to get the querystring for further action.

We are testing on both Server.Transfer and Response.Redirect. Based on various research done, we got to know the Server.Transfer has better performance if it is used to re-direct a page within the same Server. This is what we are looking at.

We do not face any issue on Response.Redirect. However, we facing issue on Server.Transfer method.

We did some test and fail to redirect our asp page to ASPX page. The .asp page code as below:

 <%@ LANGUAGE="VBSCRIPT" %>

 <%
 Server.Transfer("firsttest.aspx")
 %>

Kindly let us know how to make the .asp to .aspx page able to work for Server.Transfer.

Software and Operating System
IIS Version: 8.5
.NET Framework: 4.0/4.5
Windows Server 2012 R2
Viknes RajAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CamilliaCommented:
I don't think you can use server.transfer between classic ASP and ASP.Net. This is because  server.tranfer works within the asp.net system.

You probably have to use response.redirect.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Lokesh B RDeveloperCommented:
Hi,

Use this

<%
Response.Redirect "http://www.yoursite.com/firsttest.aspx"
%>

Open in new window

Big MontyWeb Ninja at largeCommented:
Camillia is correct, Server.Transfer passes along the session, and classic asp doesn't share sessions with .NET (and vice versa). you could either use Response.Redirect and attach any values you want to pass along as a querystring, or you can build an asp to asp.net proxy, something similar to

http://www.codeproject.com/Articles/6378/ASP-to-ASP-NET-Session-Bridge-Using-a-Web-Service
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Viknes RajAuthor Commented:
Hi,
Thanks for the direction on using response.redirect.

We also found another way using ARR URL Rewrite. Based on regular expression, we can specify the expression to accept .asp.

Do you have any experience on using URL rewrite?

What will be your recommendation?

Thanks
CamilliaCommented:
Is the performance hit that significant that you can't use response.redirect?
Viknes RajAuthor Commented:
Hi Camillia,
We are exploring the possible ways to use .asp page on .NET application at the moment.

We happened to find that URL rewrite is also possible.

We understand the behaviour of response.redirect something like IE --> .asp --> IE --> .aspx

We are just curious if URL rewrite behaves the same way?

Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.