I am debugging my solution on localhost and this piece of code is not hitting the server
var cartInfo = $j("#ctl00_BaseContentPlaceHolder_ctl00_updateShoppingCart").html();
var dataString = 'name=' + name.val() + '&email=' + email.val() + '&phone=' + phone.val() + '&date=' + date.val() + '&cart=' + cartInfo;
$j.ajax({
type: "POST",
url: "LightBoxContactSender.aspx",
data: dataString,
success: OnSuccess,
error: OnError
});
What am I missing here?
Since you are passing the
cartInfoas an html, it should be url encoded before it is posted. I think this is wat causing this issue. Try thisAs suggested by in other answer you can also pass data as a key/value pair object to
ajaxmethod, jQuery will take care the rest but you still have to encode the html content.