views:

225

answers:

4

Hi there.

I've recently upgraded a page on our server from classic asp to asp.net

The page recieves postdata and saves it to a file. The page is used by many of our clients and the url (to the asp page) is hard coded into their software. This means that i cannot simply swap the old page out for the new one. I'm trying to find a way to redirect clients from the old url to the new one. I know you can do a simple redirect using IIS, but this does not cause the postdata to be redirected. I've tried setting the file to a 307 temporary redirect, this works when the data is in the formdata but other post requests such as ones using the msxml library do not work.

Basically i need to find a way in IIS to forward a post request from one page to another without losing any of the body.

A: 

You can always program (in asp.old) a loop that goes through all the form-data and insert a record with all the values in the database. You then redirect the user to your aspx-page with the id of the row in the database as a querystring parameter. Be careful if the form-data is sensitive, to apply some sort of security to make sure users wont "steal" others data by changing the querystring.

Espo
the old page used to do this, unfortunatly we get post data in excess of 20k and converting this to text using a for loop takes far too long.
zeocrash
A: 

If the two pages are within the same application, you can use Server.Transfer. This just shifts the processing from the old page to the new one, and maintains all of the request data.

Ryan Brunner
Does this work even if the two pages uses a different technology (classic asp vs aspx)?
Espo
no this only works from clasic asp to classic asp, not classic asp to asp.net. classic asp and asp.net use different handlers, using a server transfer on a classic asp page to transfer to an asp.net page cause IIS to try processing the asp.net page with the classic asp handler and brings up an error
zeocrash
A: 

Redirect Reference (IIS 6.0) http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/41c238b2-1188-488f-bf2d-464383b1bb08.mspx?mfr=true

backslash17
does this work for post data, the examples given are all http GET.
zeocrash
Those are just for data posted with the GET method, because this technique is a URL redirection. Data postes with the POST method goes into the headers not into the URL.
backslash17
A: 

The best way i found was to use the temporary redirect code in IIS, although this didn't work for postdata originating from the msxml library. In the end i had to write a COM library in .NET to do the hard work using the system.encoding libraries and then reference the COM library in asp

zeocrash