如何将值从复选框传递到控制器MVC

时间:2018-09-17 13:40:00

标签: c# angularjs

我有一个问题,我有这个驱动程序和这个视图,并且无法获取控制器中复选框的值。 我的公共函数ActionResult CreateInvoice (invoicxmlType invoice, int? DocumentId, int taxType, String rnd, bool helpCalc = true)告诉我,我尝试从helpCalc参数传递的值是null。

这是我尝试传递名称为helpCalc的输入值的视图代码:

[@Html.Hidden("helpCalc", ViewData["helpCalc"])]

在这里,我将公共功能添加到Controller中:

public ActionResult CreateInvoice(invoicxmlType invoice, int? Id, int tax Type, String rnd, bool helpCalc = true)

当我从按钮调用函数时,我收到一条错误消息,指出helpCalcnull

enter image description here

0 个答案:

没有答案
相关问题