We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to close a dialog

Thread ID:





116097 Apr 1,2014 06:54 PM UTC Apr 4,2014 09:56 AM UTC ASP.NET MVC (Classic) 1
Tags: Dialog
Doug Matulis
Asked On April 1, 2014 06:54 PM UTC


I am looking for an example of how to add a close button to dialog box and have the dialog box close when the user clicks the close button.
Can find anything on Syncfusion's website.

Doug Matulis

Ezhil S [Syncfusion]
Replied On April 4, 2014 09:56 AM UTC


Hi Doug Matulis,



Thanks for your interest in Syncfusion products.


                We suggest you to add a close button to the dialog box using Dictionary class of dialog box control. After that call the clientsideclose event in client side and write script for that event. By using the close property of dialog method we can achieve close action through javascript.



Please refer the following code snippet:



[in View]

<div id="myDialog" title="Syncfusion Dialog" style="visibility: hidden">


    This is the Syncfusion Dialog control with the 'x' icon. The dialog    window can be moved, resized and closed.




@{Dictionary<string, string> buttons = new Dictionary<string, string>();


             buttons.Add("Close", "CloseDialog"); }





<script type="text/javascript">

    function CloseDialog(event) {









We have prepared a simple sample to showcase this behaviour and the sample can be downloaded from the following link:

Link: http://www.syncfusion.com/downloads/support/directtrac/general/DialogwithCloseButton530506377.zip



You can find the following reference link on Syncfusion’ s website

1.      http://help.syncfusion.com/ug/asp.net%20mvc/tools/documents/addingbuttonstothedi.htm

2.      http://help.syncfusion.com/ug/asp.net%20mvc/tools/documents/clientsideevents4.htm

3.      http://help.syncfusion.com/ug/asp.net%20mvc/tools/documents/clientsidemethods4.htm




Kindly try the attached sample and let us know if this helps.





This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon