kcwallace Posted May 14, 2008 Posted May 14, 2008 Can anyone tell me why the following code returns the such strange results? I cannot figure it out. :confused: CODE BEHIND [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 <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 Quote Go Beavs!!!
kcwallace Posted May 14, 2008 Author Posted May 14, 2008 I solved the problem, but I do not know why it is solved. I wrote the code in another project on another PC, and it worked perfectly. I then transferred the working page to the original application on the original PC, and it returned the same results. I then created a new application on the original PC, and copied the wirking page into the new application, and it worked perfectly. Does anyone know what setting might be incorrect in the original application to prevent it from working properly? Quote Go Beavs!!!
Administrators PlausiblyDamp Posted May 15, 2008 Administrators Posted May 15, 2008 Was there anything in the config file that could have caused this? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.