ajaxresponse after button click

  1. #1

    ajaxresponse after button click

    Hi there,

    i have a button that throws an ajaxevent, the function server side do an "if" control and return an ajaxresponse.

    here is the button code
    <ext:Button AutoPostBack=false id="btnEroga_erog" runat="server" Text="Eroga" Icon=arrowright>
        <AjaxEvents>
            <Click Before="return confirm('Avviare l\'erogazione selezionata?')" OnEvent="StartErog" Failure="alert('no')" Success="alert('yes')">
            </Click>
        </AjaxEvents>
    </ext:Button>
    here is the function code
    Dim ar As New Coolite.Ext.Web.AjaxResponse(True)
    if i = 0 Then
        ar.Success = False
        ar.Msg = "ko"
    Else
        ar.Success = True
        ar.Msg = "ok"
    End If
    ar.MakeAnswer()
    i always get a success response. how can i solve?

    Thanks
    Lex
  2. #2

    RE: ajaxresponse after button click

    Hi Lex,

    The AjaxResponse can't used in AjaxEvent handler. It used in HtppHandler/WebService (or internally).

    The Failure event fired only when Http error occured (page not found, thrown exception on server and etc). It is failure handler of XmlHttpRequest.
    In other cases the Success will be fired.

    please see this post http://forums.ext.net/showthread.php...1611-16-1.aspx

    Please let me know if need additional help

Similar Threads

  1. [CLOSED] When button click, open the menu of button
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 22, 2012, 4:23 PM
  2. Replies: 4
    Last Post: Nov 19, 2010, 1:39 PM
  3. Replies: 2
    Last Post: Oct 22, 2010, 11:04 AM
  4. [CLOSED] AjaxResponse that simulates a ServerTransfer
    By Herb in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 04, 2009, 7:09 PM
  5. Replies: 2
    Last Post: Oct 30, 2009, 1:54 PM

Posting Permissions