[CLOSED] Ext.Net.X.Call failing with "unexpected token"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Ext.Net.X.Call failing with "unexpected token"

    Have some code that used to work, trying to figure out why it's now breaking. I stripped out everything except the html and body tags and can reproduce the issue.
    The "real" code builds an html page with a table and displays it in a window to print.

    The error is Status Code: 200Status Text: BADRESPONSE: Invalid or unexpected token. If I simply remove the "</body>" tag from the code ( Ext.Net.X.Call("PrintWindow.Show", "<html><body></body></html>") ) it works, although is is invalid HTML at that point so I replaced it with "test". Like I said, this used to work, not sure if it is a browser thing or what.

    <%@ Page Language="vb" %>
    
    <script runat="server">
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not IsPostBack AndAlso Not Ext.Net.X.IsAjaxRequest Then
      
            End If
    
        End Sub
    
        <DirectMethod()>
        Protected Sub btnRefresh_Click(sender As Object, e As DirectEventArgs)
    
            Ext.Net.X.Call("PrintWindow.Show", "<html><body></body></html>")
    
        End Sub
    
     </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Edit Grid</title>
    
    <script type="text/javascript">
        
            PrintWindow = {
                Show: function (htmlBody) {
                    var wnd = window.open("about:blank", "_blank", "height=800, width=1000,toolbar=no,scrollbars=yes,menubar=no");
                    wnd.document.write('test');
                    wnd.document.close();
                    wnd.focus();
                }
            }
    
    </script>
    
    
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            
                <ext:Panel Title="Model Change Verification" runat="server" ID="pnlVerification">
                    <Items>
                       
                        <ext:Button runat="server" ID="btnRefresh" Text="ClickMe">
                            <DirectEvents>
                                <Click OnEvent="btnRefresh_Click"></Click>
                            </DirectEvents>
                        </ext:Button>
                    </Items>
     
                </ext:Panel>
        </form>
    </body>
    </html>
    Last edited by fabricio.murta; May 16, 2017 at 6:49 PM.

Similar Threads

  1. Replies: 2
    Last Post: Feb 17, 2015, 11:42 AM
  2. Replies: 5
    Last Post: Feb 17, 2015, 6:03 AM
  3. [CLOSED] HtmlEditor.Call("append", "xxx") does not work
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 17, 2014, 11:36 PM
  4. Replies: 2
    Last Post: Aug 26, 2013, 10:52 AM
  5. [CLOSED] [MVC] Export Excel return "BADRESPONSE: Unexpected token <"
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 02, 2012, 3:05 PM

Posting Permissions