mvc2中的方法调用

时间:2011-03-24 09:10:33

标签: asp.net asp.net-mvc-2

我是mvc2的新手和新手。我的模型类dat中有一个方法会在视图中显示一个饼图。现在我必须在控制器的索引方法中调用此方法。任何人都可以指导我如何做到这一点吗?

1 个答案:

答案 0 :(得分:0)

我认为模型中的方法应该为查看提供信息以创建图表。

所以:

Controller:
  get data for pie chart
  pass it to the view (return view(model))

Model 
  function to get the data for the pie chart

View
  display a pie chart with the data supplied by the controller.
相关问题