在我的項目中,我需要在Kendo窗口中放置一些窗體。這些形式是在另一個局部視圖。我用這個加載的局部視圖:在劍道窗口中使用窗體的部分視圖
@(Html.Kendo().Window()
.Name("editPasswordPopUp")
.Visible(false)
.Modal(true)
.Width(600)
.Height(500)
.Position(settings =>
settings.Top(70).Left(200))
.Title("Edit your password")
.Content("loading user info...")
.LoadContentFrom("EditPassword", "Member")
.Iframe(true)
.Resizable()
.Draggable()
)
的PartialView的動作:
public ActionResult EditPassword()
{
return PartialView();
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult EditPassword(EditPasswordViewModel viewModel)
{
[...]
return RedirectToAction("Profile", "Member", new {id = viewModel.Id});
[...]
}
這裏是我PartialView:
@model Devoteam.CustomerPortal.ViewModels.EditPasswordViewModel
@{
ViewBag.Title = "Edit";
Layout = null;
}
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/kendo")
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.Partial("_GenericMessage")
<div id="messageError">
@Html.ValidationSummary()
</div>
// FIELDS
<div class="buttons">
<input type="submit" value="Confirm" class="big-button" />
<input type="submit" value="Cancel" class="big-button" />
</div>
}
當我點擊按鈕,打開Kendo窗口,正確加載部分視圖。 當我提交表單時,正確調用了該操作。 這是我的問題:當控制器完成它的工作時,我調用RedirectToAction來重定向用戶。但是頁面加載在Kendo窗口而不是主窗口中。有沒有解決方案來關閉Kendo窗口?
第二個問題:如何在按下取消按鈕時關閉Kendo窗口?
預先感謝您。 (對不起,我的英語不好,這不是我的母語)
你設法得到這個重定向排序?關閉窗口你可以做onclick =「parent.jQuery('#windowName')。data('kendoWindow')。close();」 – Dante 2015-02-24 14:02:10