使用mvc razor从多个表中重新获取值 [英] Retriving value from multiple table using mvc razor

查看:100
本文介绍了使用mvc razor从多个表中重新获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想从mvc中的多个表中检索值。

解决方案

有两种方法可以做到。



1.通过控制器执行。

2.创建包含多个表对象的视图模型,并在需要的地方使用该视图模型。



希望它有所帮助...



Sagar Solanki


< blockquote> Hai



1.你可以创建一个View模型,如本参考文献中所述 [ ^ ]





2.您可以在视图中使用PartialView或PartialAction从控制器加载不同的模型



你也可以请参阅此链接以查看每个 http://stackoverflow.com上的小示例/ questions / 5763631 / multiple-models-in-a-single-view-c-mvc3 [ ^ ]



希望有帮助


Hi,
I want to retrive value from multiple table in mvc .

解决方案

There are two ways of doing it.

1. Do it through controller.
2. Create view model that contains object of multiple tables and use that view model wherever you need it.

hope it helps...

Sagar Solanki


Hai

1. You can create a View Model as mentioned in this reference Multiple Models in a View in ASP.NET MVC 4 / MVC 5[^]


2. You can use PartialView or PartialAction in your view to load the different model from the controller

you can also refer this link to view small examples on each http://stackoverflow.com/questions/5763631/multiple-models-in-a-single-view-c-mvc3[^]

Hope it helps


这篇关于使用mvc razor从多个表中重新获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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