我正在尝试在强类型剃刀视图中编辑项目列表.模板不允许我在单个视图中编辑对象列表,因此我将List视图与Edit视图合并.我只需要在复选框中编辑一个布尔字段.问题是我无法将数据恢复到控制器.我该怎么做?FormCollection?Viewdata?提前致谢.
这是代码:
楷模:
public class Permissao
{
public int ID { get; set; }
public TipoPermissao TipoP { get; set; }
public bool HasPermissao { get; set; }
public string UtilizadorID { get; set; }
}
public class TipoPermissao
{
public int ID { get; set; }
public string Nome { get; set; }
public string Descricao { get; set; }
public int IndID { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
控制器动作:
public ActionResult EditPermissoes(string id)
{
return …Run Code Online (Sandbox Code Playgroud) 我有点新的网络应用程序和javascript,jquery,json,淘汰赛等等的世界我试图做一些真正简单但没有开始工作.我想将数据从控制器传递到视图以使用morris.js构建绘图.
我谷歌它并尝试了几次尝试,没有成功.
视图收到类似这样的内容来构建图形:
<script>
new Morris.Line({
// ID of the element in which to draw the chart.
element: 'myfirstchart',
// Chart data records -- each entry in this array corresponds to a point on
// the chart.
data: [
{ year: '2008', value: 20 },
{ year: '2009', value: 10 },
{ year: '2010', value: 5 },
{ year: '2011', value: 5 },
{ year: '2012', value: 20 }
],
// The name of the data record attribute that contains …Run Code Online (Sandbox Code Playgroud)