开发者

How to create a key/value pair like VeiwBag in asp.net mvc?

hi guys i was wondering i开发者_如何学运维f there is any way to use dynamic data type in c# 4.0 as something like viewbag in asp.net mvc (something like the following:)

myProprty.SomeValue=SomeObject;
// which myProperty is the key and SomeVale is value of pair
//and the to retrieve the value:
object o = myProperty.SomeValue;


An ExpandoObject should do exactly what you need: http://msdn.microsoft.com/en-us/library/system.dynamic.expandoobject.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜