@Html.EJ().Dialog("Dialog2").Title("Contact Admin").ContentType("iframe").ContentUrl(Url.Action("ContactAdmin2", "Help")).Width(900).Height(500).ShowOnInit(false).EnableResize(false).EnableModal(true)
Then on my ContentURL page I have the following
<input type="submit" value="Send to admin" class="btn btn-primary" />
I want to use my controller or javascript on ContactAdmin2 Screen.
Controller code:
[HttpPost]
public ActionResult ContactAdmin2(ContactAdminViewModel contactAdminViewModel, IEnumerable
{
..do some code
return Content("< script type='text/javascript' >window.close();< / script >");
return Content("");
//I have tried the following but it only closes the content window and not the dialog window. Spaces in the script part is not part of the real code
}
@{
@Html.EJ().Dialog("Dialog2").Title("Contact Admin").ContentType("ajax").ContentUrl(Url.Action("ContactAdmin2")).Width(900).Height(500).ShowOnInit(false).EnableResize(false).EnableModal(true)
}
|
<input type="submit" value="Send to admin" class="btn btn-primary" onclick="OnClick()" />
<script>
function OnClick(args) {
var obj = $("#Dialog2").data("ejDialog");
obj.close();
}
</script> |
return Content("< script type='text/javascript' >window.parent.document.getElementById('Dialog2_closebutton').click();< / script >");
onclick="onclickBtn()" class="btn btn-link">Contact Admin @Html.EJ().Dialog("Dialog2").Title("Contact Admin").ContentType("iframe").ContentUrl(Url.Action("ContactAdmin2", "Help")).Width(900).Height(500).ShowOnInit(false).EnableResize(false).EnableModal(true) <script> function onclickBtn() { var dialogObj = $("#Dialog2").data("ejDialog"); dialogObj.open();
} script> |
<input type="submit" value="Send to admin" class="btn btn-primary" /> |
[HttpPost] public ActionResult ContactAdmin2(ContactAdminViewModel contactAdminViewModel, IEnumerable { ..do some code
return Content("< script type='text/javascript' >window.parent.document.getElementById('Dialog2_closebutton').click();< / script >");
} |
function onclickBtn() {
$("#Dialog2").ejDialog({contentType: "iframe", contentUrl: "" });
$("#Dialog2").ejDialog({contentType: "iframe", contentUrl: "../Help/ContactAdmin2" });
$("#Dialog2").ejDialog("open");
}