2

I have a jquery modal which renders a partial view however when data is entered into the view, and closed (not saved, just close the dialog) the content is retained in the view. So, next time the modal is opened, it is the same as when it was closed first time around.

Is there a way of forcing the modal to render the original partial view or make it do this? I've not posted the Partial view content as it's just a simple form with fields on.

View

<div id="client-detail-modal" title="Add New Address">
    @Html.Partial("_Address", address)
</div>

JQuery

 $("#client-detail-modal").dialog({
            modal: true,
            autoOpen: false,
            height: 'auto',
            width: 600,
            position: ['middle', 20],
            buttons: {
                "Add Address": function () {
                    $(this).dialog("close");
                },
                Cancel: function () {
                    $(this).dialog("close");
                }
            }
        });
        $('#client-detail-modal').css('height', 'auto');

Initiator

  $("#client-detail-modal").dialog("open");
4

2 に答える 2