Bootbox Dialog with Ajax Callback
<p>I have this button on the UI where the customer will open a modal. The modal will load a partial view retrieved by Ajax.</p>
<pre><code> $('#btnfeedback').on('click', function(e) {
        e.preventDefault();
        var debateModal;


        $.get('@Url.Action(&quot;LoadFeedbackModal&quot;, &quot;Home&quot;)', function() {

        }).done(function(info) {

            debateModal = bootbox.dialog(
                {
                    message: info,
                    title: '&lt;span class=&quot;fa fa-wechat&quot;&gt;&lt;/span&gt; Leave Feedback',
                    closeButton: true
                });
            debateModal.find('.modal-header').removeClass('modal-header').addClass('modal-header-info');


        }).fail(function() {
            debateModal = bootbox.alert({ message: &quot;Problem try later&quot;, size: 'small' });


        });
    });
</code></pre>
<p>And this is my Controller:</p>
<pre><code>[HttpGet]
public ActionResult LoadFeedbackModal()
{
    return PartialView(&quot;Partials/_FeedbackModal&quot;, new FeedbackVm());
}

[HttpPost]
public ActionResult LoadFeedbackModal(FeedbackVm feedback)
{
    try
    {
        var fb = Mapper.Map&lt;Feedback&gt;(feedback);

        Db.Feedbacks.Add(fb);

        Db.SaveChanges();

        return Json(new { Mensaje = &quot;Thanks for your feedback&quot;, Status = true }, JsonRequestBehavior.AllowGet);
    }
    catch (Exception exception)
    {
        return Json(new { Mensaje = &quot;HUbo un problema :( Intenta luego&quot;, Status = false }, JsonRequestBehavior.AllowGet);
    }
}
</code></pre>
<p>And this is my partial view:</p>
<pre><code>    @model TuGrietaLive.ViewModels.Admin.Index.FeedbackVm

@using (Html.BeginForm(&quot;LoadFeedbackModal&quot;, &quot;Home&quot;, FormMethod.Post))

{
    @Html.AntiForgeryToken()

&lt;div class=&quot;form-horizontal&quot;&gt;
    &lt;p&gt;
        Muchas gracias por tu Feedback. Para nosotros es muy importante.
        &lt;small&gt;Si nos dejas tu correo te podemos contestar :)&lt;/small&gt;&lt;/p&gt;
    &lt;div class=&quot;form-group&quot;&gt;
        @Html.LabelFor(m =&gt; m.FeedbackType, new { @class = &quot;control-label col-md-2 col-xs-12&quot; })
        &lt;div class=&quot;col-md-10 col-xs-12&quot;&gt;
            @Html.EnumDropDownListFor(model =&gt; model.FeedbackType, &quot;Selecciona una Categoria&quot;, new { @class = &quot;form-control&quot;, name = &quot;FeedbackType&quot; })
            @Html.ValidationMessageFor(model =&gt; model.FeedbackType)
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class=&quot;form-group&quot;&gt;
        &lt;label class=&quot;control-label col-md-2 col-xs-12&quot;&gt;Email &lt;small&gt;(Opcional)&lt;/small&gt;&lt;/label&gt;
        &lt;div class=&quot;col-md-10 col-xs-12&quot;&gt;
            @Html.EditorFor(model =&gt; model.Email, new { htmlAttributes = new { @class = &quot;form-control&quot;} })
            @Html.ValidationMessageFor(model =&gt; model.Email, &quot;&quot;, new { @class = &quot;text-danger&quot; })
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class=&quot;form-group&quot;&gt;
        @Html.LabelFor(m =&gt; m.Comment, new { @class = &quot;control-label col-md-2 col-xs-12&quot; })
        &lt;div class=&quot;col-xs-12 col-md-10 &quot;&gt;
            @Html.EditorFor(model =&gt; model.Comment, new { @class = &quot;form-control&quot; })
            @Html.ValidationMessageFor(model =&gt; model.Comment, &quot;&quot;, new { @class = &quot;text-danger&quot;, rows = 10 })
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;button type=&quot;submit&quot; id=&quot;btnsendFeedback&quot; autofocus class=&quot;btn btn-block btn-success&quot;&gt;
        &lt;span class=&quot;glyphicon glyphicon-envelope&quot;&gt;&lt;/span&gt;Enviar
    &lt;/button&gt;
&lt;/div&gt;

}
</code></pre>
<p>I can successfully get the view and the modal draws the partial. Now I want to get the response of the server after submitting the form.</p>
<p><strong>How can I get post action message? This code opens a new window with JSON object. I want to capture that and open a modal. This is killing me.</strong></p>