[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.
Code:
<%@ 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>