I have the following just before my </body>
My WebMethod in the code behind (cut down for simplicity) :HTML Code:<script type="text/javascript"> //success message.. function OnSuccess(result) { if (result) { document.getElementById("<%= lblMessage.ClientID %>").textContent = result; } } function CheckForReturnAndComplete() { if (event.keyCode === 13) { var txt1 = document.getElementById('<%=text1.ClientID %>').value; var txt2 = document.getElementById('<%=text2.ClientID %>').value; PageMethods.ScanComplete(txt1, txt2, OnSuccess, OnFailure); } } </script>
Basically when the user hits carriage return on the second textbox 'text2' the contents of text1 and text2 are sent to the [WebMethod], concatenated and returned to be displayed in a label.HTML Code:[WebMethod] public static string ScanComplete(string data1,string data2) { string returnValue = string.Empty; returnValue = data1 + " and " + data2 + " have been saved."; return returnValue; }
This works great on my dev machine but when I try it from any another machine the label does not appear. It's been a while since I have done any web work so am a wee bit confused.
Anyone have any ideas why this is happening?
Thanks in Advance





Reply With Quote