take value of return function

  1. #1

    take value of return function

    hi,

    
    [AjaxMethod]
         public string box()
         {
             return "sample";
             
         }
    ext:ToolbarButton ID="ToolbarButton2" runat="server" Text="Refresh" Icon="ArrowRefresh">
                                <Listeners>
                                 <Click Handler="Ext.Msg.alert('info', #{AjaxMethods}.box());" />
                                 
                                </Listeners>
                            </ext:ToolbarButton>
    When I Click the button I want to see value of function in this example alertt will be displayed "sample" but doesn t work, pls anyone help about this...
  2. #2

    RE: take value of return function

    Hi,

    I hope this will help you.

    [AjaxMethod]
        public string SayHello(string text)
        {
            return "Hello " + text;
        }
    
        <ext:Button ID="Button1" runat="server" Text="Say Hello">
            <Listeners>
                <Click Handler="
                    Coolite.AjaxMethods.SayHello('World', {
                        success: function (result) {
                        alert(result);
                        }
                    });" />
            </Listeners>
        </ext:Button>
    Zhivko Tropchev
  3. #3

    RE: take value of return function

    thx a lot for comment its working but
    <Click Handler="Ext.Msg.alert('fddgfdg',SHY.yenile({success: function (result){return result;}}));" />
    empty value return
  4. #4

    RE: take value of return function

    Hi,

    It is not possible to return value like you.

    Read article in main www.ext.net page.

    Zhivko Tropchev
  5. #5

    RE: take value of return function

    Hi

    change
    <Click Handler="Ext.Msg.alert('fddgfdg',SHY.yenile({success: function (result){return result;}}));"
    with
    <Click Handler="SHY.yenile({success: function (result){alert(result);}});"
    Zhivko Tropchev
  6. #6

    RE: take value of return function

    thx a lot for your help

Similar Threads

  1. Replies: 4
    Last Post: Jul 25, 2012, 5:45 AM
  2. X.Js.Call return value
    By bayoglu in forum 1.x Help
    Replies: 2
    Last Post: Jun 21, 2012, 12:54 PM
  3. Replies: 0
    Last Post: Jan 11, 2012, 8:30 AM
  4. Replies: 6
    Last Post: Mar 11, 2011, 5:30 AM
  5. How can I get return value webservice?
    By relativ in forum 1.x Help
    Replies: 0
    Last Post: Dec 02, 2009, 4:33 AM

Posting Permissions