partial view not opening as jQuery UI Dialog
I need to open a partial view as dialog box on click of a button, basically add/ Edit scenario. My problem is that mu partial view does open but not as a dialog but at the bottom of the page.

Please see my code below:
I have an empty div on the page: <div id="addEditSelectionDialog"> </div>

<div id="addEditSelectionDialog"> </div>

On the click of the button I call the below code:

function addSelectionActivate() {
        var selectionID = 0;

        $.ajax({
            url: "AddEditSelection",
            type: "POST",
            data: "&selectionID=" + selectionID,
            dataType: "html",
            success: function (data) {
                $("#addEditSelectionDialog").html(data);
                $("#addEditSelectionDialog").dialog('open');
            },
            error: function (error) {
                alert(error.status);
            }
        });
    }

My controller has a method "AddEditSelection" which returns the result. But the partial view opens at the end of the page rather than as a dialog. Please help what I might b edoing wrong.
partial view not opening as jQuery UI Dialog
===

I need to open a partial view as dialog box on click of a button, basically add/ Edit scenario. My problem is that mu partial view does open but not as a dialog but at the bottom of the page.

Please see my code below:
I have an empty div on the page: <div id="addEditSelectionDialog"> </div>

<div id="addEditSelectionDialog"> </div>

On the click of the button I call the below code:

function addSelectionActivate() {
        var selectionID = 0;

        $.ajax({
            url: "AddEditSelection",
            type: "POST",
            data: "&selectionID=" + selectionID,
            dataType: "html",
            success: function (data) {
                $("#addEditSelectionDialog").html(data);
                $("#addEditSelectionDialog").dialog('open');
            },
            error: function (error) {
                alert(error.status);
            }
        });
    }

My controller has a method "AddEditSelection" which returns the result. But the partial view opens at the end of the page rather than as a dialog. Please help what I might b edoing wrong.