tags:

views:

444

answers:

3

Here's my scenario:

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).

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 error 'ASP 0221' Invalid @ Command directive /MyApp/NewXmlHandler.aspx, line 1

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

Thanks!

+1  A: 

Put the form values into querystrings (URL encode them) and then use Response.Redirect instead. Server.Transfer resumes execution and you cannot execute an ASP.NET page in ASP 3.0.

Nissan Fan
I think the two potential issues here are 1) is there a length limit for a url? and 2) I don't know if the desktop application could respond to a redirect request
John
Well, another solution would be to put them into the session and share the session:http://msdn.microsoft.com/en-us/library/aa479313.aspx
Nissan Fan
A: 

Can you use ASP.NET routing? If so, just route the POST to the .aspx page instead of the .asp page.

mgroves
A: 

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
%>
John