asp.net webform 使用 html partial,asp.net-mvc – 在kendo窗口中使用表单的PartialView

西门逸仙
2023-12-01

在我的项目中,我需要在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")

@Html.ValidationSummary()

// FIELDS

}

当我单击按钮打开Kendo窗口时,部分视图正确加载到其中.

当我提交表单时,操作被正确调用.

这是我的问题:当控制器完成其工作时,我调用RedirectToAction来重定向用户.但页面加载在Kendo窗口而不是主窗口中.关闭Kendo窗口有什么解决方案吗?

第二个问题:按取消按钮时如何关闭Kendo窗口?

先感谢您. (抱歉我的英语不好,这不是我的母语)

 类似资料: