【发布时间】:2016-01-13 22:18:53
【问题描述】:
它是这样来的
一旦我从先前的操作发送IEnumerable<ProductsPropertiesVM> model 数据,我可以使用上述方法过滤一些选定的ID
一旦我在调试模式下运行它,selectedIDs 通常会像这样显示
我需要使用以下方法发送该数组
[HttpGet]
[ValidateInput(false)]
public ActionResult Create_Brochure(IEnumerable<ProductsPropertiesVM> model)
{
// to access to all the ID's of the selected items, for example
IEnumerable<int> selectedIDs = model.Where(x => x.IsChecked).Select(x => x.Property_ID);
PrepairEditor(delegate (Editor editor)
{
editor.LoadHtml("~/brochuretemplates/myhtml.html");
});
return View();
}
所以我需要将那些selectedIDs 发送到myhtml.html 文件
如果换个方式问,
(如果我认为 selectedIDs 可以作为数组发送)
我想知道我们如何在 selectedIDs 数组上方附加 editor.LoadHtml("path") 。
【问题讨论】:
-
将它们作为 URL 参数附加。
-
怎么做?但这里它不仅仅是一个值,实际上是它的一组值
-
将数组转换为json并传递
-
在你的数组上做一个连接,使它看起来像这样:1,2,然后将它传递到 url:editor.LoadHtml("~/brochuretemplates/myhtml.html?selectedIDs=1,2 ");
-
@vijayP 在下面添加了一个答案,这就是我的建议。这应该对你有用。
标签: c# jquery html asp.net-mvc append