Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 24th, 2012  |  syntax: None  |  size: 1.01 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. url decoding in asp.net
  2. wanted result:
  3. mylefturl/first%20name/last%20name
  4.  
  5. this is what's actually happenning:
  6. mylefturl/first name/last name
  7.        
  8. var firstName = $("#SignupFirstName").val();
  9.             var lastName = $("#SignupLastName").val();
  10.             var email = $("#SignupEmail").val();
  11.             var password = $("#SignupPassword").val();
  12.  
  13.             var url = '/Ajax/GetSignup/' + encodeURIComponent(firstName) + '/' + encodeURIComponent(lastName) + '/' + encodeURIComponent(email) + '/' + encodeURIComponent(password);
  14. $.ajax({
  15.                     url: u,
  16. ...
  17.        
  18. var firstName = $("#SignupFirstName").val(),
  19.     lastName = $("#SignupLastName").val(),
  20.     email = $("#SignupEmail").val(),
  21.     password = $("#SignupPassword").val();
  22.  
  23. $.ajax({
  24.     url: '/Ajax/GetSignup/',
  25.     type: 'POST',
  26.     data: {
  27.         firstName: firstName,
  28.         lastName: lastName,
  29.         email: email,
  30.         password: password
  31.     },
  32.     success: function(result) {
  33.         // TODO: process the results from the AJAX call
  34.     }
  35. });