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.

Create Dialog in Server-Side

Thread ID:

Created:

Updated:

Platform:

Replies:

119276 May 30,2015 02:32 PM Jun 3,2015 08:27 AM ASP.NET MVC 3
loading
Tags: Dialog
Julio
Asked On May 30, 2015 02:32 PM

Hi

My question is how can i create a control from the server-side, especially a Dialog control; or maybe create the Control in the client-side and then execute it in the server-side.

Example.cshtml:

@{Html.EJ().Dialog("basicDialog").Title("Basic").ContentTemplate(@<div>Message</div>));}

ExampleController.cs:

if("something"){
(basicDialog,Show)
}

Thank you so much for your help

Regards.

Kasithangam C [Syncfusion]
Replied On June 1, 2015 09:08 AM

Hi Julio,

We have achieved your requirement “create the Control in the client-side and then execute it in the server-side (show dialog)” and please find the sample under the following location,


Sample: Sample


In this above sample, we have created the wrapper for dialog control in view page and set the property “showOnInit” as false via codebehind.Initially it doesn’t shows the dialog.Please find the wrapper code,


<code>


@{Html.EJ().Dialog("basicDialog",Model).Render();}


</code>


In the button click event, we have enabled this property in the controller as shown below code.Now the dialog control get displays.

 

<code>


public ActionResult Index(string basicDialog)

        {

            Syncfusion.JavaScript.Models.DialogProperties dia = new Syncfusion.JavaScript.Models.DialogProperties();

            dia.ShowOnInit = true;

            return View(dia);

        }

</code>


Please let us know if you have any further assistance,

Regards,

Kasithangam


Julio
Replied On June 2, 2015 12:50 PM

Hi, thank you for your replay, it is working very well. But now I would like to know how can i set the content proprieties. I am thinking with the "ContentTemplate " propriety:

Syncfusion.JavaScript.Models.DialogProperties dia = new Syncfusion.JavaScript.Models.DialogProperties();
dia.ShowOnInit = true;
dia.Title = "Mensaje";
dia.ContentTemplate = ???
return View(dia);

Regards. 

Kasithangam C [Syncfusion]
Replied On June 3, 2015 08:27 AM

Hi Julio,


Thanks for your update.


We need to set the contentTemplate property in controller page as shown below code,


<code>

Syncfusion.JavaScript.Models.DialogProperties dia = new Syncfusion.JavaScript.Models.DialogProperties();

            dia.ShowOnInit = true;

            dia.ContentTemplate = new MvcTemplate<object>

            {

                RazorViewTemplate = (data) =>

                {

                    return "<div>Message</div>";

                }

            };

            return View(dia);

</code>


Also we have modified the sample based on this and please find the sample under the following location,


Sample: Sample


Please let us know if you have any further assistance,

Regards,

Kasithangam


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.

;