[CLOSED] How to send the variable string in AutoLoadParams

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] How to send the variable string in AutoLoadParams

    I have (C#):
    this.StoreMain.AutoLoadParams["session_name"] = "={" + this.CACHE_Prefix + "}";
    Java return:
    ...
    autoLoad:{params:{"start":0,"limit":100,"sort":"","dir":"","session_name":DevicesdlDevices}}
    ...
    A error is a result
    How it is possible to do??:
    ...
    autoLoad:{params:{"start":0,"limit":100,"sort":"","dir":"","session_name":"DevicesdlDevices"}}
    ...
    And for what I should write this way? "={}" what's this?
    Last edited by Daniil; Jul 22, 2011 at 3:34 PM. Reason: [CLOSED]
  2. #2
    Hi,

    ={} means Raw mode of a parameter.

    For example:

    1. A value will be string.
    AutoLoadParams["test"] = "5";
    2. A value will be int.
    AutoLoadParams["test"] = "={5}";
    I guess you just don't need to use ={} syntax.
  3. #3
    he isn't coming off. Similar result.

    But i'm received this way:
    this.StoreMain.AutoLoadParams["session_name"] = "={\"" + this.CACHE_Prefix + "\"}";
    it works
  4. #4
    This should work as well.
    this.StoreMain.AutoLoadParams["session_name"] = this.CACHE_Prefix;
  5. #5
    Quote Originally Posted by Daniil View Post
    This should work as well.
    this.StoreMain.AutoLoadParams["session_name"] = this.CACHE_Prefix;
    I got the result in HTML code:
    ...
    autoLoad:{params:{"start":0,"limit":100,"sort":"","dir":"","session_name":DevicesdlDevices}}
    ...
    and javascript error: ....`DevicesdlDevices' not found.
  6. #6
    Is the CACHE_Prefix string?

    Here is my test case.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.AutoLoadParams["session_name"] = "test";
        }
    </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>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Store ID="Store1" runat="server">
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="test1" />
                            <ext:RecordField Name="test2" />
                            <ext:RecordField Name="test3" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
        </form>
    </body>
    </html>
  7. #7
    test it:
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.AutoLoadParams["session_name"] = "test";
        }
    </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 id="Head1" runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Store ID="Store1" runat="server">
                <AutoLoadParams>
                    <ext:Parameter Name="session_name" Mode="Raw" />
                </AutoLoadParams>
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="test1" />
                            <ext:RecordField Name="test2" />
                            <ext:RecordField Name="test3" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
        </form>
    </body>
    </html>
  8. #8
    Thanks for the example.

    Should be
    Mode="Value"
  9. #9
    Quote Originally Posted by Daniil View Post
    Thanks for the example.

    Should be
    Mode="Value"
    ok, I understood
  10. #10
    when I am clicking to the next page GridPanel, the AutoLoadParam["session_name"] isn't handing the variable over "test"?
    I took the example https://examples1.ext.net/#/GridPane...rting/Handler/ and I added
    <script runat="server">
        
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.AutoLoadParams["session_name"] = "test";
        }
        
    </script>
    What then again is not this way?
Page 1 of 2 12 LastLast

Similar Threads

  1. Cant send html string as parameter to AjaxMethod
    By masudcseku in forum 1.x Help
    Replies: 9
    Last Post: Jul 19, 2011, 11:38 PM
  2. Can I send a string with html tag to Ajaxmethod?
    By masudcseku in forum 1.x Help
    Replies: 1
    Last Post: Jul 19, 2011, 11:31 PM
  3. Replies: 1
    Last Post: Feb 28, 2011, 9:13 AM
  4. [CLOSED] Difference between store's AutoLoadParams and BaseParams
    By jchau in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 16, 2009, 7:04 AM
  5. Replies: 3
    Last Post: Nov 12, 2008, 6:16 AM

Tags for this Thread

Posting Permissions