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.

Dialog load URL and ReturnValue

Thread ID:

Created:

Updated:

Platform:

Replies:

121938 Feb 10,2016 03:49 AM Feb 18,2016 07:59 AM ASP.NET MVC 7
loading
Tags: Dialog
Emil Yotov
Asked On February 10, 2016 03:49 AM


Hello, I have some questions related to the Dialog. How can its content to be loaded when you open it /when click the button that opens dialog/ , not when the page loads? I want content that opens the dialog to be a URL to a page on my website.
How to get from the loaded page /shown in the dialog/ return value?

Francis Paul Antony Raj [Syncfusion]
Replied On February 11, 2016 08:30 AM

Hi Emil,


Thanks for contacting Syncfusion support.


We have analyzed your query. You can load the dialog content while open the dialog using our existing ejDialog property “ContentType” by setting its value as ajax and along with setting the desired url in “ContentUrl” property. Please refer the following code snippet.

@Html.EJ().Dialog("dialog").Title("Dialog").ContentType("ajax").ContentUrl("Home/Dialog").ShowOnInit(false).IsResponsive(true).ClientSideEvents(evt => evt.Close("onDialogClose"))

For your convenience, we have attached the sample to show case this. Please get the sample from the below location.

http://www.syncfusion.com/downloads/support/directtrac/general/ze/dialog1297913412

In this sample we have also showcased the data retrieving from dialog in controller section.

To know more about dialog properties, methods and events, please refer to,

http://help.syncfusion.com/js/api/ejdialog

To know about how to load the ajax content in dialog, please refer to,

http://help.syncfusion.com/aspnetmvc/dialog/load-content

Please let us know, if you need any further assistance.


Regards,

Francis Paul A


Emil Yotov
Replied On February 11, 2016 09:36 AM

Hi, in your example everything is OK, but copy the sample code in my project dialog opens in page load and URL link does not open page - just dialog shows progress.
I do not know what exactly is the problem. It may be _Layout.cshtml. Here are the declarations of HEAD:


<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ovelon CRM</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

    @*mobile components CSS styles reference*@
    <link rel='nofollow' href="@Url.Content("~/Content/ej/web/Default-theme/ej.widgets.all.min.css")" rel="stylesheet" />


    <script src="@Url.Content("~/Scripts/jquery-1.10.2.min.js")"></script>
    <script src="@Url.Content("~/Scripts/jsrender.min.js")"></script>
    <script src="@Url.Content("~/Scripts/jquery.easing.1.3.min.js")"></script>

    @*web & mobile components script reference*@
    <script src="@Url.Content("~/Scripts/ej/ej.web.all.min.js")"></script>
    <script src="@Url.Content("~/Scripts/ej/ej.unobtrusive.min.js")"></script>

    <script src="@Url.Content("~/Scripts/ej/cultures/ej.culture.en-US.min.js")"></script
</head>



Below have the following code /after RenderBody/

@Html.EJ().ScriptManager()
                @RenderSection("scripts", required: false)
                <script type="text/javascript">
                    //To prevent input controls auto initialization, we need to set this property
                    App.renderEJMControlsByDef = false;
                    //To prevent the initialization of AppView, we need to set this property
                    App.preventAppviewInit = false;
                    $(function () {
                        $('#page').css("min-height", $(document).height());
                    });

                </script>

Francis Paul Antony Raj [Syncfusion]
Replied On February 12, 2016 10:02 AM

Hi Emil,


Sorry for the inconvenience.


We have analyzed your query. We suspect that ContentUrl with improper format leads to the incorrect navigation of page which causes your reported issue. If we give ContentUrl like “Home/Dialog” and sets the http://localhost:63279/Home/index as startup page, then ContentUrl mapped from its parent controller and set as http://localhost:63279/Home/Home/Dialog which is invalid.

To resolve this please make sure to give the “ContentUrl” started with “/”, else provide the url as Url.Action(“view”, “controller”). If we set url as “/Home/Dialog”, then it gets mapped as http://localhost:63279/Home/Dialog and which is valid.


Please refer the following code snippet


@Html.EJ().Dialog("dialog").Title("Dialog").ContentType("ajax").ContentUrl("/Home/Dialog").ShowOnInit(false).IsResponsive(true).ClientSideEvents(evt => evt.Close("onDialogClose"))  

                                        (or)

@Html.EJ().Dialog("dialog").Title("Dialog").ContentType("ajax").ContentUrl(Url.Action("Dialog", "Home")).ShowOnInit(false).IsResponsive(true).ClientSideEvents(evt => evt.Close("onDialogClose"))

Please check with the given solution. If still you are facing any difficulties, please provide more information about your issue. We will be happy to help you.


Regards,

Francis Paul A


Emil Yotov
Replied On February 15, 2016 10:50 AM

Is there a way to charge the Dialog view , not just a partial view. If not, how can I use components Syncfusion in open Dialog? In partial view not load HEAD declarations.

Thank You

Francis Paul Antony Raj [Syncfusion]
Replied On February 16, 2016 10:40 PM

Hi Emil,


We have analyzed your query. You can use our components inside ejDialog, when the ejDialog content loaded through ajax request. Please check with the following solution.


Please ensure that whether the unobtrusive mode in web.config file is true or false.


#1) If unobtrusive mode is true (“<add key="UnobtrusiveJavaScriptEnabled" value="true" />”), then please refer the “unobtrusive.min.js” file in “_Layout” Page and you need to trigger the “ej.widget.init()” function before the dialog content opens using “beforeopen” event of dialog.

#2) If unobtrusive mode is false (“<add key="UnobtrusiveJavaScriptEnabled" value="false" />”), then please use “@Html.EJ().ScriptManager() at the end of partial view (“Dialog”) Page


For your convenience, we have attached the sample in the below location.

http://www.syncfusion.com/downloads/support/forum/121938/ze/Dialog-1108542379

Please check with the given solution and let us know, if you need any further assistance.


Regards,

Francis Paul A


Emil Yotov
Replied On February 17, 2016 05:14 AM

Thank You, Francis.

Francis Paul Antony Raj [Syncfusion]
Replied On February 18, 2016 07:59 AM

Hi Emil,


Thanks for your update.

We hope that your problem has been resolved now. Kindly get back to us if you need any further assistance.


Regards,

Francis Paul A


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.

;