Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
Image button post back on webdialog close (x)
posted

Hi,

I have a image button which displays infragistics webdialog and the dialog needs to post back up on clicking 'Ok'(ok button inside the dialog). This works fine. The dialog page also has cancel button which hides dialog page when clicked. This too is working fine. Ok and cancel has onclick events which work fine(window state is hidden). But only problem occuring is when I try to close window (hit x on top right corner of webdialog) is that it is posting back. If I use link button instead of image button, this works fine (even though link button also opens webdialog and posts back when ok is clicked inside the web dialog and hides dialog when cancel clicked). I tried all the options but could not supress post back on closing web dialog. I used below but nothing works. Please help me.

return false at the end of function , onmouseover="this.style.cursor = 'pointer';"

onclientclick instead of onclick,

type="button" instead of type="submit" (default)

autopostback="false"

CausesValidation = False

Parents
  • 20255
    Offline posted

    Hello Deepu,

    Thank you for contacting us.

    As I understand you want to trigger a postback when the 'x' button of the dialog is clicked. By design we do not provide a functionality that can handle this click, although my suggestion is to use jQuery in order to catch the click of the html element and then use doPostBack in order to create a postback to the server. I have created sample for you in order to show you this approach.

    Code snippet:

    1. $(function () {
    2.             $('.igdw_HeaderButtonArea').on("click", function (event) {
    3.                 alert("X clicked");
    4.                 __doPostBack();
    5.             });
    6.         });

    You can have a look at the article below regarding __doPostBack function:

    http://www.codeproject.com/Articles/667531/doPostBack-function

    Could you please let me know if I am missing something from your scenario. Looking forward to hearing from you.

    Example.zip
Reply Children