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.
Unfortunately, activation email could not send to your email. Please try again.

How to close a dialog

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hello,

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.

Thanks,
Doug Matulis

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

 

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:

 

<code>

[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.

 

</div>

 

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

  

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

 

@Html.Syncfusion().Dialog("myDialog").Width(200).Height(100).AutoOpen(true).ClientSideClose("CloseDialog").Buttons(buttons)

 

[Script]

<script type="text/javascript">

    function CloseDialog(event) {

 

        $("#myDialog").dialog("close");

 

    }

</script>

 

</code>

 

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.

 

Regards,

Ezhil.S


CONFIRMATION

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.

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.

;