Hey guys. I am a student and new to AJAX programming in general, so forgive me if my questions are simple or non-sensical.
I have a web service as follows (C# code-behind):
[WebMethod]
public string AddCardToDatabase(String playerName, String team, String year, String ownerID)
{ //body ommitted due to irrelevence }
And I have Javascript as follows:
function ()
{
var player = $get('txtPlayerName').value;
var team = $get('txtTeam').value;
var year = $get('txtYear').value;
var userID = $get(val).value;
//Clear the text boxes.
$get('txtPlayerName').value = "";
$get('txtTeam').value = "";
$get('txtYear').value = "";
CardService.AddCardToDatabase(player, team, year, userID, onComplete, onFailure);
}
function onComplete(arg)
{
$get('response').innerHTML = arg + "
Please add your next card.";
document.getElementById("UpdatePanel1").update();
}
function onFailure()
{
alert("We are sorry, but your request could not be completed.");
}
I've tested, and all the variables I'm attempting to pass as parameters do have values. Also I know the web service is being called and can respond, but why does it keep calling the onFailure method??
Any suggestions you can make would be appreciated.