why i can't call the ajax method in mvc applications?

  1. #1

    why i can't call the ajax method in mvc applications?

    in controller:
    [AjaxMethod]
            public AjaxResult Test()
            {
                return new AjaxResult { Result = "Hello world" };
            }
    in aspx page:
    <ext:Button ID="btnSearch" runat="server" Text="test" >
                                    <Listeners>
                                        <Click Handler="Coolite.AjaxMethods.Test();" />
                                    </Listeners>
                                 </ext:Button>
    why can't find the test method;
    sorry,my english is poor!

    thanks you!
  2. #2

    RE: why i can't call the ajax method in mvc applications?

    Hi,

    You have to set Url for AjaxMethod which pointing to the controller action and use pure calling because proxy method doesn't generated
    Coolite.AjaxMethod.request('Test', {url:'/ControllerName/Test/', cleanRequest: true});
  3. #3

    RE: why i can't call the ajax method in mvc applications?

    got it ,thank you!

Similar Threads

  1. how to call direct method in asp.net mvc3
    By waqasde in forum 2.x Help
    Replies: 1
    Last Post: Mar 16, 2012, 9:26 AM
  2. [CLOSED] Call other window's method
    By FAS in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 14, 2012, 4:03 PM
  3. Ajax Method call Hierarichy
    By kumarxlnt in forum 1.x Help
    Replies: 2
    Last Post: Oct 27, 2009, 1:48 AM
  4. How to call serverSide method from javascript
    By designworxz in forum 1.x Help
    Replies: 2
    Last Post: Mar 09, 2009, 11:26 PM
  5. method call
    By mono in forum 1.x Help
    Replies: 1
    Last Post: Mar 09, 2009, 6:46 AM

Posting Permissions