模板:
控制类:
using System.Collections.Generic;
namespace Cvv.WestcoMarketing.WebApp.PageControllers
{
class Index : BaseController
{
public void Run()
{
List<int> ls = new List<int>();
for (int i = 0; i < 20; i++)
{
ls.Add(i * i * i);
}
ViewData["ls"] = ls;
}
}
}
<div class="content">
$for(var v in ls){
$if(v>10){<div style="color:Red;">$v</div>}else{<div>$v</div>}
}
</div>
$for(var v in ls){
$if(v>10){<div style="color:Red;">$v</div>}else{<div>$v</div>}
}
</div>
namespace Cvv.WestcoMarketing.WebApp.PageControllers
{
class Index : BaseController
{
public void Run()
{
List<int> ls = new List<int>();
for (int i = 0; i < 20; i++)
{
ls.Add(i * i * i);
}
ViewData["ls"] = ls;
}
}
}
posted @ 2011-07-27 22:12 黄志强 阅读(38) 评论(0) 编辑
