[CLOSED] AjaxMethod Error = BADRESPONSE: Syntax error

  1. #1

    [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.


    <%@ 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>
  2. #2

    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.


    Geoffrey McGill
    Founder & CEO
  3. #3

    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

Similar Threads

  1. Replies: 0
    Last Post: Aug 09, 2012, 2:27 PM
  2. Replies: 17
    Last Post: Oct 12, 2011, 5:54 PM
  3. Replies: 4
    Last Post: Sep 26, 2011, 3:59 PM
  4. [CLOSED] BADRESPONSE: syntax error
    By asztern in forum 1.x Premium Help
    Replies: 10
    Last Post: Feb 09, 2011, 11:22 PM
  5. Replies: 4
    Last Post: Jan 25, 2011, 11:39 AM

Posting Permissions