MVC4可以在转发器或数据列表中的一个视图中使用多个表来检索数据吗? [英] can MVC4 trieve data using multiple table in one view within repeater or datalist?

查看:75
本文介绍了MVC4可以在转发器或数据列表中的一个视图中使用多个表来检索数据吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只需要一些问题清楚地询问,

i在一个视图中使用文本框和标签查看了许多用于多个表检索的文章。

但是我想要问任何不可能使用检索数据到转发器或datalist?



sry,我对这个MVC4非常困惑。请给我一些建议,非常感谢

Just some question needed ask clearly,
i got review many article for multiple table retrieve in one view using textbox and label.
but i wanna ask got any impossible using retrieve data to repeater or datalist?

sry, i very confuses regarding this MVC4. please give me some advise, thanks alot

推荐答案

在ASP.NET MVC中使用ASP.NET webform控件并不是一个好习惯。如果你想实现像datalist和repeater这样的控件,你需要创建自定义的html helper,否则为这个控件创建一个通用的html结构并循环遍历这些项目。微软在asp.net MVC中没有为datalist和repeater提供内置控件。通过获取viewsource,在ASP.NET webform应用程序中运行此结构后,您将获得转发器和datalist html结构。



有用的链接

http://www.devcurry。 com / 2013/04 / datalist-in-aspnet-mvc-knockoutjs.html#.UhSdW9InpBE [ ^ ]



http://codesprouts.com/post/ASPNet-MVC-DataList-Extension.aspx [ ^ ]



http://www.asp.net/mvc/ tutorials / older-versions / views / creating-custom-html-helpers-cs [ ^ ]



希望这有帮助
It's not a good practice of using ASP.NET webform controls in ASP.NET MVC. If u want to implement the controls like datalist and repeater u need to create custom html helper else create a common html structure for this control and loop through the items. There are no inbuilt control provided by microsoft in asp.net MVC for datalist and repeater. You will get the repeater and datalist html structure after running this in the ASP.NET webform application by taking the viewsource.

Useful links
http://www.devcurry.com/2013/04/datalist-in-aspnet-mvc-knockoutjs.html#.UhSdW9InpBE[^]

http://codesprouts.com/post/ASPNet-MVC-DataList-Extension.aspx[^]

http://www.asp.net/mvc/tutorials/older-versions/views/creating-custom-html-helpers-cs[^]

Hope this helps


这篇关于MVC4可以在转发器或数据列表中的一个视图中使用多个表来检索数据吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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