如何发送比表单更多的数据-使用帮助程序BeginForm

问题描述

我将模型发送到我的视图。我的模型是:

@model Onlineshop.Models.viewmodels.ManageProfileviewmodel

public class ManageProfileviewmodel
    {
        public ManageProfile ManageProfile { get; set; }
        public ManagePassword ManagePassword { get; set; }
    }

我认为我有只更改密码的表格。

@using (@Html.BeginForm("UpdatePassword","Manage",FormMethod.Post)) { //some code }

然后我在控制器UpdatePassword中有动作Manage,其操作作为参数ManageProfileviewmodel

public async Task<ActionResult> UpdatePassword(ManageProfileviewmodel model)

在我的操作中,模型仅包含ManagePassword,但ManageProfile为空。 是否可以使用表单传递包括ManageProfile的整个视图模型?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)