On my layout view I have
@Html.MakePopup(new MakePopupParams
{
Action = "Create",
Title = "New Job Offer",
Modal = true,
Resizable = false,
Height = 450,
Width = 750,
Position = "center"
})
<div style="padding-left: 10px">
@Html.PopupActionLink(new PopupActionLinkParams
{
Action = "Create",
Text = "Add new Job Offer",
HtmlAttributes = new { @class = "btn btn-success btn-small" }
})
</div>
This renders a button that creates a dialog where a view (Create) is rendered. Everything works fine.
The problem is when I submit the form, if the ModelState is not valid I want to return the view, with the model, and the validation messages. But if I return the view like this
// there is something wrong with the data values
return View(newOffer);
The browser shows the view as a whole.
How can I return the view to the dialog that is opened?