页面视图:
<p class="text-center text-muted">文章来源:@ent.Origin 点击量:@ent.Hits <Script Language="Javascript" Src="/Web/UpdateClick/@ent.Id"></Script> 日期:@ent.CreateDate </p>
控制器代码:
public ActionResult UpdateClick(int Id)
{
var entity = DataFactory.Database().FindEntity<SitesDetails>(Id);
DataFactory.Database().Update<SitesDetails>(Id, "Hits", entity.Hits + );
return Content((entity.Hits + ).ToString());
}