我有一个简单的问题:使用剑道窗口,我可以像这样刷新它:
window.refresh({
url: '@Url.Action("_EditScheduleInspectionForm", "TLM")',
我想将参数传递给该控制器操作。我尝试了以下方法并且有效:
window.refresh({
url: '@Url.Action("_EditScheduleInspectionForm", "TLM", new { test = "test"})',
控制器
public PartialViewResult _EditScheduleInspectionForm(string test)
该test
变量用传递的字符串“test”填充。但我不想硬编码字符串,我想在那里传递一个 javascript 变量,例如:
var test = "something";
window.refresh({
url: '@Url.Action("_EditScheduleInspectionForm", "TLM", new { test = test})',
但以上不起作用,变量无法识别。我怎样才能做到这一点?