I have a dialog box that uses the Entity foo
.
After I save the values from this dialog box I do the following :
$('#SaveEditPQ').submit(); //jquery submit
$("#NewQuickDlg.results").remove(); // clear the fields within the dialog Box
$("#AddQuickDlg").dialog("close"); // close the dialog box.
Now ... the issue comes when i try to use (metadata) validating. I want to keep the Dialog Box open if the ModelState.IsValid
is false.
This can be solved non-elegantly by extending my foo
entity with a value that will get the value of the ModelState.IsValid
and change my Jquery to :
$('#SaveEditPQ').submit();
if ('@Model.IsValidVariable'==true)
{
$("#NewQuickDlg.results").remove();
$("#AddQuickDlg").dialog("close");
}
Is this the best way to do this ?