摘要: ViewData 和 TempData 都可以传递弱类型数据,区别如下:ViewData 只在当前 Action 中有效,生命周期和 View 相同;TempData 的数据至多只能经过一次Controller传递,并且每个元素至多只能被访问一次,访问以后,自动被删除。TempData 一般用于临时的缓存内容或抛出错误页面时传递错误信息,可以将TempData 在使用之前存储到相应的 ViewData 中以备循环使用。Indexpublic ActionResult Index(){ ViewBag.Message = "Welcome to ASP.NET MVC!"; 阅读全文
posted @ 2012-09-02 21:20 john8412 阅读(221) 评论(0) 推荐(0)
摘要: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”><html xmlns=”http://www.w3.org/1999/xhtml”><head><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /><title>email + jquery 正则表达式</title>&l 阅读全文
posted @ 2012-08-03 17:11 john8412 阅读(381) 评论(0) 推荐(0)
摘要: ASP.NET MVChas changed the way .NET developers write web applications just hasjQueryhas changed the way developers approach javascript. If you haven't taken a look at either, I highly recommend checking out both. ASP.NET MVC allows for a cleaner separation of concerns, ultimately leading to clea 阅读全文
posted @ 2012-08-02 00:40 john8412 阅读(326) 评论(0) 推荐(0)