Send complex object to AjaxMethod

  1. #1

    Send complex object to AjaxMethod

    Hi,

    I just wanted to know if it was possible to pass a complex object to an AjaxMethod.

    I am first retreiving a complex object from an AjaxMethod and then passing it to another one. I have put it all into one class and for ease of explanation have ripped out most of the code.

    eg.

    
    <ext:Button ID="btnSave" runat="server" Text="Finish">
         <Listeners>
              <Click Handler="getData();" />
         </Listeners>
    </ext:Button>
    
    <script type="text/javascript">
    
            function getData(){
                Coolite.AjaxMethods.GetData({success:loadData});   
            }
           
            function loadData(result){
                Coolite.AjaxMethods.LoadData(result);
            }
    
    
    </script>
    CodeBehind

    
            [AjaxMethod]
            public TestData GetData()
            {
                TestData td = new TestData();
                td.ID = 1;
                td.Value = "Value";
    
                return td;
            }
    
            [AjaxMethod]
            public void LoadData(TestData td)
            {
                
            }
  2. #2

    RE: Send complex object to AjaxMethod

  3. #3

    RE: Send complex object to AjaxMethod

    Hi,

    Thanks for your reply. I did read that thread earlier but not sure if it is the same situation. I basically call an ajax method and return an ajax method and then I want to pass it to another one. It hasnt been deconstructed and I thought should be quite easy but I havent been able to acheive this.


    Thanks

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, 10: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, 10:31 PM
  3. Can Store.DateSource send sub object to client?
    By firebank in forum 1.x Help
    Replies: 2
    Last Post: Apr 15, 2010, 11:48 AM
  4. Replies: 4
    Last Post: Feb 02, 2010, 1:00 PM
  5. Represent Complex Object on a Grid
    By nanosassa in forum 1.x Help
    Replies: 0
    Last Post: Sep 03, 2009, 1:38 PM

Posting Permissions