视图数据和视图之间的区别是什么?在MVC中查看包 [英] what is difference between view data & view bag in MVC

查看:117
本文介绍了视图数据和视图之间的区别是什么?在MVC中查看包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实时查看数据和视图包之间的区别。

difference between view data & view bag in real time.

推荐答案

您好,



有看看这里:

什么是ViewData,ViewBag和TempData? - 用于在当前和后续请求之间传递数据的MVC选项 [ ^ ]

http://brendan.enrick.com/post/difference-between-viewbag-and-viewdata-in-mvc-3.aspx [ ^ ]

http://stackoverflow.com/questions/4705426/whats-the-difference-between-viewdata- and-viewbag [ ^ ]

http://stackoverflow.com/questions/7993263/viewbag-viewdata-and-tempdata [ ^ ]
Hi,

Have a look here:
What is ViewData, ViewBag and TempData? – MVC options for passing data between current and subsequent request[^]
http://brendan.enrick.com/post/difference-between-viewbag-and-viewdata-in-mvc-3.aspx[^]
http://stackoverflow.com/questions/4705426/whats-the-difference-between-viewdata-and-viewbag[^]
http://stackoverflow.com/questions/7993263/viewbag-viewdata-and-tempdata[^]


ViewBag [ ^ ]。它是动态类型的属性[ ^ ](而不是链接显示的对象) - 自框架版本4起可用。提供与 ViewData [ ^ ],但使用起来更方便。您可以同时使用它们,但它们没有链接,它们是两个绝对独立的属性。在后台,两个都是字典。

Som其他文献:什么是ViewData,ViewBag和TempData的? - 用于在当前和后续请求之间传递数据的MVC选项 [ ^ ]

http://brendan.enrick.com/post/difference-between-viewbag-and-viewdata-in-mvc-3.aspx [ ^ ]
ViewBag[^] was introduced with MVC3. It is a property of type dynamic[^] (and not Object as the link is showing it) - available since framework version 4. It serves the same use as ViewData[^], but it is more convenient to use. You can use both, but they are not linked, they are two absolutely separate properties. In the background, both are dictionaries.
Som other literature: What is ViewData, ViewBag and TempData? – MVC options for passing data between current and subsequent request[^]
http://brendan.enrick.com/post/difference-between-viewbag-and-viewdata-in-mvc-3.aspx[^]


这篇关于视图数据和视图之间的区别是什么?在MVC中查看包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆