Link to home
Start Free TrialLog in
Avatar of andrewh123
andrewh123

asked on

Posting html form to another domain from asp.net page

Hi,
I'm trying to have a login page on 1 new site (an asp.net site) that sends the username, password and a hidden field to another website that will carry out a login procedure.
I have made an html form outside of the rest of the normal asp.net form area (see below).  When the submit button is pressed the browser moves to the correct page but doesn't take the variables with it.

The receiving page is on an NT server, not running .net and it is a pure asp environment.
To look for the variables on the receiving page I have stripped everthying out apart from the following code:

For Each ServerVariable In Request.ServerVariables
Response.Write "<BR>" & "" & ServerVariable & ": " & Request.ServerVariables(ServerVariable) & ""
Next
response.write "P=" & request("txtPassword")
response.write "<BR>U=" & request("txtName")

I'm a bit concerned that either  I've missed something incredibly dumb or this will never work because of something to do with .net .
I currently do a similiar login process from 1 doamin to another where the sending page is pure asp.

Hope someone can help....
Andrew



asp.net form section
<div id="logIn">
<form id="frm_logon" name="frm_logon" action="http://mydomain.com/test.asp" method="post" >
      <asp:label id="lblLoginTitle" runat="server">Professional users log in here:</asp:label><br>
      <asp:label id="lblUsername" runat="server">Username</asp:label>&nbsp;<INPUT class="textfieldSmall" id="txtName" type="text" size="5">
      <asp:label id="lblPassword" runat="server">Password</asp:label>&nbsp;<INPUT class="textfieldSmall" id="txtPassword" type="password" size="5">
      <input type="hidden" name="dom_country" value="uk">
      <INPUT class="textfieldSmall" id="btnLogin" type="submit" value="Login">
</form>
</div>

<form id="Form1" method="post" runat="server">

rest of asp page...
Avatar of ayha1999
ayha1999

Hi,

use

Server.Transfer("yourpage")

which will transfer all form variabels to next page.

whre you can retrive it like

Request.Form("FieldName")

hope this helps.

ayha
Avatar of andrewh123

ASKER

Hi ayha- thanks for this but (and I'm sorry if this wasn't clear in the question), the page I'm posting to is on another domain.  If I use server.transfer:

Server.Transfer("http://www.mydomain.com/test.asp")

 to the other domain I get the following error:

Invalid path for child request 'http://www.mydomain.com/test.asp'. A virtual path is expected

Cheers
Andrew
ASKER CERTIFIED SOLUTION
Avatar of ihenry
ihenry

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I knew it would be soemthing dumb - d'oh.

Thanks a lot for spotting this - it was driving me mad, everything works fine now.

Andrew