[英]What is the best solution for displaying data in ASP.NET MVC?
I am new to ASP.NET MVC and I want to know your opinion about what is the best way to display some data from database using a <table>
... an ASP.NET control or a jqGrid ? 我是ASP.NET MVC的新手,我想知道您对于使用<table>
...从ASP.NET控件或jqGrid显示数据库中某些数据的最佳方法是什么的看法 ?
In which situation must each of them be used? 在每种情况下都必须使用它们?
I appreciate any tips. 我感谢任何提示。 Thanks. 谢谢。
如果我理解正确,那么MVC模型不支持标准asp.net控件的服务器端事件处理,因此我想说jquery网格绝对是最佳选择。
Asp.net controls cannot be used in asp.net mvc. 在ASP.NET MVC中不能使用ASP.NET控件。
The best way is to create a ViewModel classes and declare View as strongly typed. 最好的方法是创建一个ViewModel类,并将View声明为强类型。 I could continue but unfortunately don't know what exactly do you need. 我可以继续,但不幸的是不知道您到底需要什么。
Do you mean ASP.NET Controls or ASP.NET MVC Controls? 您是指ASP.NET控件还是ASP.NET MVC控件?
ASP.NET Server Controls should not be used in this framework... or rather, you should not use anything that relies on postbacks and/or viewstate. ASP.NET Server控件不应在此框架中使用...或更确切地说,您不应使用任何依赖于回发和/或视图状态的控件。 There are tricks to get some to work, but YMMV. 有一些技巧可以使一些工作,但YMMV。
If the control is an ASP.NET MVC Control, that's a different story, and it will work ok. 如果该控件是ASP.NET MVC控件,那就是另一回事了,它将正常运行。 JQuery controls also work since they are javascript controls. jQuery控件也是javascript控件,因此也可以使用。
use the MvcContrib grid. 使用MvcContrib网格。 it is working fine 运行正常
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.