Hi,
In my project, I need to put some forms in kendo windows. These forms are in other partial view. I use this to load the partial view :
And here is my PartialView :
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 his 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 my project, I need to put some forms in kendo windows. These forms are in other partial view. I use this to load the partial view :
01.
@(Html.Kendo().Window()
02.
.Name("editPasswordPopUp")
03.
.Visible(false)
04.
.Modal(true)
05.
.Width(600)
06.
.Height(500)
07.
.Position(settings =>
08.
settings.Top(70).Left(200))
09.
.Title("Edit your password")
10.
.Content("loading user info...")
11.
.LoadContentFrom("EditPassword", "Member")
12.
.Iframe(true)
13.
.Resizable()
14.
.Draggable()
15.
)
1.
public
ActionResult EditPassword() {
2.
return
PartialView();
3.
}
1.
[HttpPost]
2.
[ValidateAntiForgeryToken]
3.
public
ActionResult EditPassword(EditPasswordViewModel viewModel)
4.
{
5.
[....]
6.
return
RedirectToAction(
"Profile"
,
"Member"
,
new
{id = viewModel.Id});
7.
[....]
8.
}
And here is my PartialView :
01.
@using Devoteam.CustomerPortal.Application.Helpers
02.
@model Devoteam.CustomerPortal.ViewModels.EditPasswordViewModel
03.
@{
04.
ViewBag.Title = "Edit";
05.
Layout = null;
06.
}
07.
08.
@Styles.Render("~/Content/css")
09.
@Scripts.Render("~/bundles/jquery")
10.
@Scripts.Render("~/bundles/jqueryval")
11.
@Scripts.Render("~/bundles/kendo")
12.
13.
@using (Html.BeginForm())
14.
{
15.
@Html.AntiForgeryToken()
16.
17.
<
div
id
=
"messageError"
>
18.
@Html.ValidationSummary()
19.
</
div
>
20.
[...] // Fields
21.
22.
<
div
class
=
"buttons"
>
23.
<
input
type
=
"submit"
value
=
"Confirm"
class
=
"big-button"
/>
24.
<
input
type
=
"submit"
value
=
"Cancel"
class
=
"big-button"
/>
25.
</
div
>
26.
}
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 his 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.