[CLOSED] AjaxMethod Error = BADRESPONSE: Syntax error
I can't seem to get the most basic example of the AjaxMethod working. Below is a page that is one of the examples from the Coolite.Examples. It works in the examples, but not in my project. I'm using build 0.7.0.19508 in both cases. It returns the string 'BADRESPONSE: Syntax error'. If you put a breakpoint in the Server AjaxMethod, you will see it gets called.
Ive tried different return values, using AjaxResponse, making it static. Nothing seems to work!!!
Is there some kind of WebConfig requirement or some other esoteric setting that is needed?
Also, see my other outstanding post: http://forums.ext.net/showthread.php...4863-16-1.aspx for other problems I'm having with Ajax->Server calls.
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test5.aspx.cs" Inherits="Test5" %>
<%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
<!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 runat="server">
<title></title>
<script runat="server">
[AjaxMethod]
public string GetTimeStamp() {
return DateTime.Now.ToLongTimeString();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<ext:Button ID="Button1" runat="server" Text="Run Test">
<Listeners>
<Click Handler="Coolite.AjaxMethods.GetTimeStamp({
success: function(result) {Ext.Msg.alert('Server Time', result);},
failure: function(result) {Ext.Msg.alert('Failed', result);}
});" />
</Listeners>
</ext:Button>
</form>
</body>
</html>
RE: [CLOSED] AjaxMethod Error = BADRESPONSE: Syntax error
Hi Randy,
The following forum post should help, see*http://forums.ext.net/showthread.php...-1.aspx#bm2547
If using v0.7 and at any point you use the Controls in Design mode, the web.config settings will be automatically added. I'll be adding a sample web.config to the "Getting Started" section in the examples explorer.*
Hope this helps.
RE: [CLOSED] AjaxMethod Error = BADRESPONSE: Syntax error
Geoffrey;
Thanks, that solved this problem. I'll go back and retest the WCF service issue described in the other post and let you know the results.
-Randy