When trying to call an ASP.NET method through DirectEvents get BADRESPONSE: Syntax error

  1. #1

    When trying to call an ASP.NET method through DirectEvents get BADRESPONSE: Syntax error

    Environment:
    Ext.NET 1.2.0.21945
    .NET Framework 4.0, Visiual Studio Web Developer 2010 Express, MVC 3, IIS Express, SQL Server 2005 Express
    Debuging under WinXP and IE8

    Problem Description:
    On any direct call to a asp.net method through DirectEvents property of a Ext.Net Control, I get a Status Code:200 BADRESPONSE: Syntax error.
    For Example, with code:
        <ext:Button id="testbtn" runat="server" Text="test">
            <DirectEvents>
                <Click OnEvent="TestEvent" />
            </DirectEvents>            
        </ext:Button>
        Protected Sub TestEvent(sender As Object, e As DirectEventArgs)
            MsgBox("safsadf")
        End Sub
    When I click the Button testbtn, a message box with text "safsadf" will be shown, and when OK is clicked, an error window like this is displayed.
    Title: Request Failure
    Status Code: 200
    Status Text: BADRESPONSE: Syntax error
    A Textbox contains the web page where the Button testbtn resides (without css applied).
    Click image for larger version. 

Name:	Untitled.jpg 
Views:	390 
Size:	15.3 KB 
ID:	3242

    This error happens to each and every DirectEvents item I tried, including DirectEvents of window and treegrid.

    This error happens both when the button is enclosed in <form id="someID" runat="server"></form> block and when the button is not enclosed in such a block.
    After searching the forum I've tried to add AjaxRequestModule in web.config like
      <system.webServer>
        <modules>
          <add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.DirectRequestModule, Ext.Net" />
          <add name="AjaxRequestModule" preCondition="managedHandler" type="Ext.Net.AjaxRequestModule, Ext.Net" />
        </modules>    
        <handlers>
          <add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler" />
          <add name="AjaxRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler" />
        </handlers>
      </system.webServer>
    and the error still happen.

    Is there a solution to this issue? Any feedback will be appreciated.
  2. #2
    'system.webServer' is IIS 7 section only
    For other IIS you have to use 'system.web' section
  3. #3
    Quote Originally Posted by Vladimir View Post
    'system.webServer' is IIS 7 section only
    For other IIS you have to use 'system.web' section
    Thansk Vladimir. Actually I tried to use both system.webserver and system.web, and neither works. The same error occurs.
  4. #4
    Can you provide test project (zip archive without assemblies)?
  5. #5
    Here is my test project. It seems this forum does not supprot uploading zip file, so I changed the extension name to pdf to fool it.
    It is actually a zip file so change its extension to zip to open it.
    MvcTestApp.pdf
    Thanks very much Vladimir.

Similar Threads

  1. Replies: 0
    Last Post: Aug 09, 2012, 1:27 PM
  2. [CLOSED] DirectEvents call method codebehind
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Sep 05, 2011, 3:03 PM
  3. [CLOSED] BADRESPONSE: syntax error
    By asztern in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Feb 09, 2011, 10:22 PM
  4. Replies: 2
    Last Post: Jan 14, 2011, 5:51 PM
  5. [CLOSED] AjaxMethod Error = BADRESPONSE: Syntax error
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 05, 2008, 6:37 PM

Posting Permissions