
Untitled
By: a guest on
May 24th, 2012 | syntax:
None | size: 1.01 KB | hits: 11 | expires: Never
url decoding in asp.net
wanted result:
mylefturl/first%20name/last%20name
this is what's actually happenning:
mylefturl/first name/last name
var firstName = $("#SignupFirstName").val();
var lastName = $("#SignupLastName").val();
var email = $("#SignupEmail").val();
var password = $("#SignupPassword").val();
var url = '/Ajax/GetSignup/' + encodeURIComponent(firstName) + '/' + encodeURIComponent(lastName) + '/' + encodeURIComponent(email) + '/' + encodeURIComponent(password);
$.ajax({
url: u,
...
var firstName = $("#SignupFirstName").val(),
lastName = $("#SignupLastName").val(),
email = $("#SignupEmail").val(),
password = $("#SignupPassword").val();
$.ajax({
url: '/Ajax/GetSignup/',
type: 'POST',
data: {
firstName: firstName,
lastName: lastName,
email: email,
password: password
},
success: function(result) {
// TODO: process the results from the AJAX call
}
});