This is really strange but this code is working fine unless the value entered by the user includes an asterik (*) or other characters like $ or #. The #ticketNumber.Val() is the suspected problem. Some of our id's have an * in them. Any help would be appreciated.
function buttonClicks() {
var action = '/ServiceCall/IsAServiceCall/' + $('#ticketNumber').val() + '?x=' + new Date().getTime();
$('#ticketNumberFilter').hide();
$('#loading').show();
$.getJSON(action,
{ ticketNumber: $("#ticketNumber").val() },
function(callData) {
if (callData.status == true) {
window.location = "/ServiceCall/Show/" + $("#ticketNumber").val();
}
else {
$('#loading').hide()
$('#ticketNumberFilter').show();
$("#ticketListMessage").slideDown("slow");
$("#ticketNumber").val("");
}
});
}
Here's the controller: When there is an *, the controller never gets hit:
public JsonResult IsAServiceCall(string ticketNumber)
{
IServiceCallService scService = new ServiceCallService();
return (Json(new { status = scService.IsAServiceCall(ticketNumber) } ));
}