我正在尝试使用html beginform将JS变量发送到控制器操作。例如:
@using (Html.BeginForm("Index", "Contrl1", new { SPName = myJSVarcomeshere }, FormMethod.Post))
{
<button id="plot" type="submit" class="btn" > Plot </button>
}
目前的问题是JS变量不在作用域内。我可以使用隐藏字段来解决这个问题。