• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 733
  • Last Modified:

Need to post asp.net page form to another page/server

My employer outsources some of their record keeping, and as a result some of our client visit our page and then, upon clicking a link, are taken to the consulting firm's site. I'd like to be able to create a page on our site that will post the user's login/password info to the consultant's page.

How can I post our form data to the form on the consultant's site? I'm using c# and JavaScript fyi.
0
asphaltninja
Asked:
asphaltninja
1 Solution
 
ProculopsisCommented:

You could try something like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q__26816630.html</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>

<script type="text/javascript"> 

$(document).ready(function() {

  $("#alternate").click( function() {
    var form = $(this).closest("form");
    if ( this.checked ) {
      form.attr( "rel", form.attr( "action" ) );
      form.attr( "action", "https://www.paypal.com/uk/cgi-bin/webscr?cmd=_login-run" );
    } else {
      form.attr( "action", form.attr( "rel" ) );
    }
  });


});

</script>
<style type="text/css">@import "http://images.experts-exchange.com/getCSS?key=/00203/ee_NS|--base,xp--base,--component,xp--component,--formFactory,xp--formFactory,xp--button,xp-include-infoBox&t=1297363483000";</style>
</head>
<body>

<fieldset id="loginPopup" style="width: 300px; padding: 10px; margin-left: auto; margin-right: auto;"><legend>Login</legend>

<form method="post" action="http://www.experts-exchange.com/login.jsp" name="loginPopupForm">
  <input type="hidden" name="msuLoginSubmit" value="1" />
  <div><label for="lpumsuLoginName">Username or Email:</label></div>
  <div><input type="text" id="lpumsuLoginName" name="msuLoginName" value="" class="text" tabindex="1" /></div>
  <div><label for="lpumsuPassword">Password:</label><a href="/forgotPassword.jsp" rel="nofollow" style="margin-left: 48px; text-decoration: none;">Forgot your password?</a></div>
  <div><input type="password" id="lpumsuPassword" name="msuPassword" value="" class="text" tabindex="2"  /></div>
  <div class="rMeBox">
    <div class="rMeInput">
      <label for="alternate">Alternate Login</label>
      <input type="checkbox" id="alternate" name="msuRememberMe" class="checkbox" tabindex="3" />
    </div>
    <div class="rMeShared">Submit login details to affiliate site</div>
  </div>
  <div class="clear"></div>
  <div class="nvpButtons">
   <input type="hidden" name="redirectURL" value="/Programming/Languages/Scripting/JavaScript/Q__26816630.html?qid=26816630" />
   <div class="nvCancel"><a href="#" tabindex="5">Cancel</a></div>
   <button type="submit" class="lpbSubmit" tabIndex="4">Login</button>
   <div class="clear"></div>
  </div>
</form>

</fieldset>

</body>
</html>

Open in new window

0
 
BadotzCommented:
Just in case the Asker doesn't speak "jQuery", any chance for a non-jQuery example?
0
 
asphaltninjaAuthor Commented:
Hello and thanks for the reply. I'd also need them to be taken to the other site after being logged in through the page I create.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now