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. Image for the cookie policy date

Any example about Dialog Modal???

I would like to create an application that when you click in a button open one modal dialog a previously created view. The dialog modal will contain a form to create/edit records in a database. I can do a basic example on what you get. No bd, just with a simple list like that they build in the grid is not required...
Thank you

1 Reply

ES Ezhil S Syncfusion Team April 3, 2014 11:53 AM UTC

Hi Jesus Sanchez,

 

Thank you for using Syncfusion products.

 

To create a modal dialog with a partial view on button click event, we suggest you to create a partial view with the required data. Now create a <div> for dialog and add the partial view into the div element using @Html.Partial(). Now create dialog using Syncfusion.Dialog() and set Modal(true), please refer the following code snippet,

 

<code>

[View]

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

@Html.Partial("ViewUserControl1"

</div>

<input type="button" value="Modal dialog" onclick=" dialogopen()" />

@Html.Syncfusion().Dialog("dialogContents").Width(300).Height(400).AutoOpen(false).Modal(true)

 

[Script]

<script type="text/javascript">

    function dialogopen() {

        $("#dialogContents").dialog("open");

    }

</script>

</code>

 

We have prepared a simple sample to load partial view into modal dialog, which can be downloaded from the following link:

Modaldialog_f116096.zip

 

Kindly let us know if you require further assistance on this.


Regards,

Ezhil S


Loader.
Live Chat Icon For mobile
Up arrow icon