Skip to content

Infragistics Community Forum / Web / Ultimate UI for ASP.NET Web Forms / Cancel the button click event from code behind

Cancel the button click event from code behind

New Discussion
Bernie
Bernie asked on Nov 23, 2015 8:52 AM

I am trying to figure out how to cancel the click event from code behind as I don't want my page to post back.  I can't seem to find this anywhere.  If I were to use a standard asp button I would just use the e.Cancel = True.  Thanks in advance.

Sign In to post a reply

Replies

  • 0
    Nadia Robakova
    Nadia Robakova answered on Nov 18, 2015 11:48 AM

    Hi,

    Thank you for using our forum.

    You want to cancel the event you have to return false or to set e.Cancel=True.

    In which control you are trying to cancel click event?

    • 0
      Bernie
      Bernie answered on Nov 18, 2015 2:06 PM

      Nadia, 

      Thanks for the quick response.  I am using the WebImageButton.  I will attach some code that I am using as the code doesn't recognize the cancel method of the e object.

      Private Sub cmdSave_Click(sender As Object, e As Infragistics.WebUI.WebDataInput.ButtonEventArgs) Handles cmdSave.Click
      If UpdateRecord() Then
      MsgBox("Record is saved.", MsgBoxStyle.OkOnly, "Record Saved")
      Else
      e.cancel = True
      End If
      End Sub

      • 0
        Nadia Robakova
        Nadia Robakova answered on Nov 23, 2015 8:52 AM

        Hi,

        It is not possible to cancel the click event from the client side.

        You can only cancel the event form the client side.

        Please let me know if I can provide any further assistance

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Bernie
Favorites
0
Replies
3
Created On
Nov 23, 2015
Last Post
10 years, 3 months ago

Suggested Discussions

Created by

Created on

Nov 23, 2015 8:52 AM

Last activity on

Feb 16, 2026 9:38 PM