tags:

views:

23

answers:

2

I need to emulate a login where I pass the username and password to the asp.net page from classic asp page.
Did an exhausted search on this propble could not find good technique. Is http post to the asp.net from classic asp the right approch. If yes code snippet would be helpful.

What other techniques can we use to accomplish this task?

+1  A: 

Another technique could be to share the authenticated username via session: How to Share Session State Between Classic ASP and ASP.NET.

XIII
the asp.net page is on an external site with its own creadentials to pass. Hence passing seesion value is not applicable in this case.
Ibrar Afzal
@Ibrar, you didn't mention that in your original question hence I thought all ran on the same server.
XIII
+1  A: 

Any standard HTTP POST will work just fine. In the .aspx page that handles the POST it will just need to check Request.Form for the key/value pairs from the classic form's POST.

If you don't control the .aspx page or can't change its code, then you can try naming the form elements in the classic ASP form the same as the ones in the .NET login form that it's emulating. I haven't tried that personally, but it's worth a shot.

David
David do you have a code snippet?
Ibrar Afzal
For the classic ASP? No. But you can just look at the HTML rendered by the .aspx login form and copy the names/ids of the input elements for the username and password (and anything else you might need).
David