[CLOSED] JSON.Deserialize backslash and double-quote fixing

Page 2 of 2 FirstFirst 12
  1. #11
    in 'name' box first for '"", second for '\'.

    "filters":"{\"Code\" : \"\",\"Name\" : \"\"\"}"
    
    "filters":"{\"Code\" : \"\",\"Name\" : \"\\\"}"
    which added to the store as lastOptions.params parameter.
  2. #12
    See the example below.

    1. Type backslash into TextField1
    2. Type double quote into TextField2
    3. Click on the button
    4. The problem you described doesn't appear

    So, please provide your full test case to reproduce. Please remove all things which are not required to reproduce.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        [DirectMethod]
        public void Test(string value)
        {
            X.Msg.Alert("DirectMethod", JSON.Deserialize<object>(value).ToString()).Show();
        }
    </script>
     
    <!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>Ext.Net Example</title>
        
        <script type="text/javascript">
            var onClick = function () {
                X.Test({ 
                    filters: { 
                        Code : TextField1.getValue(), 
                        Name : TextField2.getValue() 
                    } 
                });
            }
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" DirectMethodNamespace="X" />
            <ext:TextField ID="TextField1" runat="server" />
            <ext:TextField ID="TextField2" runat="server" />
            <ext:Button runat="server" Text="Send to server and deserialize">
                <Listeners>
                    <Click Fn="onClick" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
  3. #13
    yes i failed to regenerate the bug with directMethod. but that's not the case with webservice call!!

    so after i invest deeply inside extjs/extnet code, the directMethod fully supported with correct encoding. extnet parse each request param in directMethod and added to the string. json.encode didn't give same results that directMethod auto-encoding use.

    so that's was not fair comparison :( i can't switch my code to DM. so try to use ASMX and feel the pain.

    thanks anyway
  4. #14
    Please provide a simple .aspx page and .asmx to reproduce.
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [CLOSED] json deserialize problem
    By albayrak in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 21, 2015, 2:28 PM
  2. Replies: 2
    Last Post: May 29, 2011, 3:42 AM
  3. [CLOSED] Json Deserialize error when save
    By vali1993 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 07, 2010, 2:39 PM
  4. [CLOSED] JSON.Deserialize Lastes SVN
    By egodoy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 21, 2010, 5:59 PM
  5. [CLOSED] [1.0] Ext.encode and JSON.Deserialize
    By state in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 14, 2010, 8:03 AM

Posting Permissions