[HttpGet] public ActionResult SigningIn() { if (Request.IsAjaxRequest()) { return PartialView("_PartialSigningIn"); } return View(); } [HttpPost] public ActionResult SigningIn(Account account3) { if (!ModelState.IsValid) { if (Request.IsAjaxRequest()) return PartialView("_PartialSigningIn",account3); } return View(account3); }
@model GoGrain.Models.Account <h2>SigningIn</h2> @Html.Partial("_PartialSigningIn")
<pre lang="sql">@model GoGrain.Models.Account @using (Ajax.BeginForm(new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "signinginDialog" })) { @Html.ValidationSummary(true) @Html.EditorForModel() }
<script type="text/javascript"> $.ajaxSetup({ cache: false }); $(document).ready(function () { $(".openDialog").live("click", function (e) { e.preventDefault(); $("<div></div>") .addClass("dialog") .attr("id", $(this) .attr("data-dialog-id")) .appendTo("body") .dialog({ title: $(this).attr("data-dialog-title"), close: function () { $(this).remove() }, modal: true }) .load(this.href); }); $(".close").live("click", function (e) { e.preventDefault(); $(this).closest(".dialog").dialog("close"); }); }); </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)