kcwallace
Centurion
Can anyone tell me why the following code returns the such strange results? I cannot figure it out.
CODE BEHIND
CLIENT SIDE
txtState displays:
CODE BEHIND
Code:
[System.Web.Services.WebMethod()]
public static String getCity2()
{
return "No Parameter";
}
[System.Web.Services.WebMethod()]
public static String getCity1(string strVal)
{
return strVal;
}
CLIENT SIDE
Code:
<script type="text/javascript" language="JavaScript">
$addHandler($get("txtMailingZip"),"keyup",CallParametersPageMethod);
function CallParametersPageMethod()
{
var strVal=document.getElementById("txtMailingZip");
PageMethods.getCity1('92614',onSucceeded,onFailed);
}
function onSucceeded(result,userContext,methodName)
{
var strVal=document.getElementById("Label1");
strVal.innerHTML="inSucceed";
document.form1.txtState.value=result;
}
function onFailed(error,userContext,methodName)
{
}
</script>
txtState displays:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head><title> Untitled Page</title></head><body> <form name="form1" m