使用另一个对象的viewmodel中的viewmodel设置readonly属性 [英] Set readonly property with viewmodel from another object's viewmodel
本文介绍了使用另一个对象的viewmodel中的viewmodel设置readonly属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从另一个视图模型中提取名称字段,以便显示它而不是当前视图模型中的ID。 这将是来自另一个表格的名称,与...相关联当前视图模型中的ID - 类似于
查找表。 我认为可以在控制器中使用方法在getter中完成,但我不清楚如何做到这一点。
有人可以提供一个例子吗?
解决方案
他们正在谈论MVC 那种方式---> http://forums.asp.net/1146.aspx/1?MVC
I want to pull in a name field from another view model so it can be displayed instead of the ID that's in the current view model. This will be a name from another table that correlates with an ID in the current view model - similar to a look up table. I'm thinking it can be done in the getter with a method in the controller, but I'm not clear on how to do it.
Can someone please provide an example of this?
解决方案
They are talking MVC that a way ---> http://forums.asp.net/1146.aspx/1?MVC
这篇关于使用另一个对象的viewmodel中的viewmodel设置readonly属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文