Click here to Skip to main content
15,903,523 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I want to open MVC view as a dialog.
I am using following code inside webgrid.

C#
theGrid.Column("ReSubmit", format: (item) => Html.ActionLink("ReSubmit Package", "ReSubmitPackage", new { id = item.Jobid },
                                                   new { @class = "dialog" }))


C#
$(function () {
            $('a.dialog').click(function () {
                var url = $(this).attr('href');
                var dialog = $('<div style="display:none"></div>').appendTo('body');
                debugger;
                dialog.load(url, {},
                    function (responseText, textStatus, XMLHttpRequest) {
                        dialog.dialog({
                            close: function (event, ui) {
                                dialog.remove();
                            }
                        });
                    });
                return false;
            });
        });



But when i click on link i got error in console that, Uncaught TypeError: dialog.dialog is not a function

my jquery version is 2.1.0 and jquery ui is 1.11.4.

Can any one plz help on this.
Posted
Comments
Can you check if the dialog function is available in the UI js?
Mostafa Asaduzzaman 8-Jun-15 17:52pm    
Why don't you use modal instead of MVC view? Modal with jquery will allow you to pass data back and forth

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900