In my project, I need to put some forms in Kendo windows. These forms are in another partial view. I use this to load the partial view :
@(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()
)
The actions of the PartialView :
public ActionResult EditPassword()
{
return PartialView();
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult EditPassword(EditPasswordViewModel viewModel)
{
[...]
return RedirectToAction("Profile", "Member", new {id = viewModel.Id});
[...]
}
And here is my 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>
}
When I click on the button to open the Kendo window, the partial view load correctly in it. When I submit my form, the action is correctly called. Here is my problem: When the controller has done its job, I call a RedirectToAction to redirect the user. But the page is loaded in the Kendo window instead of the main window. Is there any solution to close the Kendo window?
Second question: How to close the Kendo window when pressing the cancel button?
Thank you in advance. (Sorry for my poor English, this is not my native language)