I have a form in asp.net with a few textboxes. I'm trying to post the values in them to the server using jquery ajax, but having problems. I'm using javascript encodeURIComponent for the values of the textboxes, and then posting, but I see that the url is encoded automatically:
wanted result:
mylefturl/first%20name/last%20name
this is what's actually happenning:
mylefturl/first name/last name
and so I get an asp.net error ...
my javascript code:
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,
...
What is the solution to this ?