< 2025年6月 >
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 1 2 3 4 5
6 7 8 9 10 11 12
  2011年7月25日
摘要: ASP.NET MVC 3 可以通过强类型将数据传递给视图,下面详细解释下传递的方法首先我们需要在model里定义一个数据模型类,当然该类也可以从数据对象生成#region 模型public class TestModel{public string test1 {get;set;}public string test2 {get;set;} } #endregion 这里仅定义了一个最简单的类我们在control里对其做简单的赋值,然后传递给视图 public ViewResult Index(){ TestModel test = new TestModel(); test.test1 = 阅读全文
posted @ 2011-07-25 16:29 cmoon 阅读(5734) 评论(5) 推荐(0)
点击右上角即可分享
微信分享提示