一直忘记了,发布NerdDinner的代码程序,有了程序,可以很方便的学习asp.net mvc 这个框架。

下载地址是NerdDinner_1.0.zip

其实asp.net mvc 框架很好理解,无非就是Model-View-Control,其中control中每一个方法都对应着一个view,例如下面

public ActionResult Details(string id)
{
GetNowUser(User.Identity.Name);
GetDetail(id);
return View();

}

那么就一定会存在一个Details页面,并且接受一个参数id,这样来看的话,就很清楚了吧。asp.net mvc框架也就那么回事。不是很难。

//产品详细信息
public ActionResult GetDetail(string id)
{
ICardType cardType = new CardType();
CardTypeEntity cardTypeEntity = cardType.SelectCardTypeByID(Convert.ToInt32(id));
return View ("DetailControl",cardTypeEntity);    //向视图压入了一个对象cardTypeEntity,可以在View里面调用后台的对象变量
}

posted on 2010-01-07 23:12  技术宅男  阅读(997)  评论(1编辑  收藏  举报