Return View as a Modal
<p>I am trying to return a modal from my controller post action of a previous modal. The issue I am having is that the partial view is not rendered as a modal. All the documentation I can find refers to opening a modal from a button, however my modal is conditional so I want the controller to handle whether or not to load the modal / which modal to load</p>

<p><strong>Part of partial view where I return the view containing the modal</strong></p>

<pre><code>return PartialView("_AccountUpdateSuccess");
</code></pre>

<p><strong>My View</strong></p>

<pre><code>&lt;div class="modal fade" tabindex="-1" role="dialog" id="updateSuccess"&gt;
    &lt;div class="modal-dialog" role="document"&gt;
        &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
                &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
                &lt;h4 class="modal-title"&gt;Success!&lt;/h4&gt;
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
                &lt;p class="text-success"&gt;@ViewBag.Account has been updated successfully!&lt;/p&gt;
            &lt;/div&gt;
            &lt;div class="modal-footer"&gt;
                &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
            &lt;/div&gt;
        &lt;/div&gt;&lt;!-- /.modal-content --&gt;
    &lt;/div&gt;&lt;!-- /.modal-dialog --&gt;
&lt;/div&gt;&lt;!-- /.modal --&gt;


&lt;script type="text/javascript"&gt;
    $(document)
        .ready(function() {
            $("#updateSuccess").modal('show');
        });
&lt;/script&gt;
</code></pre>