View Full Version : [CLOSED] Help on proxy exception JS error

Jun 11, 2012, 7:45 AM
Hi guys, please help me on the following code

<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"></head>
<body id="theBody">
<ext:ResourceManager ID="theManager" runat="server" IDMode="Inherit" Theme="Default"
EnableViewState="false" DisableViewState="true" ShowWarningOnAjaxFailure="false"
ScriptMode="Debug" />
<ext:Store runat="server" ID="s" AutoLoad="false">
<ext:Model runat="server">
<ext:ModelField Name="ItemName" />
<ext:ModelField Name="ItemValue" />
<ext:Button runat="server" Text="Test" Scale="Medium">
<Click Handler="testFunc();" />
<script language="javascript" type="text/javascript">

var exProcess = function (proxy, response, operation) {
var testFunc = function () {
var store = <%= s.ClientID %>;
<form runat="server" id="theForm" />
<script runat="server">

protected override void OnInit(EventArgs e)
AjaxProxy ajaxProxy = new AjaxProxy() { Url = "/test.aspx/getexception" };
ajaxProxy.ActionMethods.Read = HttpMethod.POST;
ajaxProxy.Listeners.Exception.Fn = "exProcess";
ajaxProxy.Reader.Add(new JsonReader() { Root = "data", TotalProperty = "total" });

The MVC action code is as the this:

public AjaxResult GetException()
return new AjaxResult()
ErrorMessage = "Exception found."

I encounter a JS error when dispose the alert window (screenshot is attached). Any ideas?

Jun 11, 2012, 9:59 AM

Please set up

MessageProperty = "message"
for the JsonReader.

Also please use StoreResult instead of AjaxResult. StoreResult is designed for AjaxProxy.