如何在c#中使用mvc使用Listview [英] How to use Listview in c# using mvc

查看:129
本文介绍了如何在c#中使用mvc使用Listview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends。



我有一个任务,必须使用MVC在Listview中显示学生姓名。我不知道。任何人都可以帮助解决我的问题



在此先感谢。

病毒:)

Hello Friends.

I have One Task, Have to Display Student Name in Listview using MVC. I Have no idea about it. Can Anyone Help to solve my Problem

Thanks In Advance.
Viral :)

推荐答案

使用MVC时不建议使用ASP.Net Page控件。



因为ASP.NET MVC不使用视图状态维护状态信息,如果需要,您必须找到管理状态信息的其他方法。此外,依赖于视图状态和回发的服务器控件将无法在ASP.NET MVC应用程序中按设计工作。因此,您不应该使用GridView,Repeater和DataList控件之类的控件。



http://msdn.microsoft.com/en-us/library/dd381619(v = VS.100)的.aspx [<一个href =http://msdn.microsoft.com/en-us/library/dd381619(v=vs.100).aspx\"target =_ blanktitle =New Window> ^ ]
It's not recommended to use ASP.Net Page controls when using MVC.

Because ASP.NET MVC does not maintain state information by using view state, you must find other ways to manage state information, if you need it. In addition, server controls that rely on view state and postback will not work as designed in an ASP.NET MVC application. Therefore, you should not use controls such as the GridView, Repeater, and DataList controls.

http://msdn.microsoft.com/en-us/library/dd381619(v=vs.100).aspx[^]


ListView只是一个控件,可以从数据源启用数据绑定。您不需要仅使用MVC来使用它,您也可以在Web窗体中使用它。



如果您刚读完MSDN 文档 [ ^ ]对于ListView,您可以轻松理解ListView的概念,即允许用户以列表的形式从数据源(可以是数据库,json对象等)获取结果,他们可以执行编辑,选择,删除,更新等任务。有关使用ListView的更多信息,您可以阅读本段中的附加文档。



但通常最好问一下如何在我的{control}中使用{control} {project}并附加msdn到它。 MSDN对所有Microsoft产品都有最佳概述,您可以从中学到几乎所有内容。他们的概述也有很多评论。看看这个发布 [ ^ ]。他们分享他们的观点,使用ListView的最佳实践,MVC可以是使用ListView的项目模板。
ListView is just a control that enables data binding from a Data source. You don't need to be working with only MVC to consume it you can use it in Web Forms too.

If you've just read the MSDN documentation[^] for the ListView you would have easily understood the concept of the ListView, that is, to allow the users to get the results from the data source (can be a database, a json object etc) in the form of a list, where they can perform tasks like Edit, Select, Delete, Update and many more. For more on working with ListView you can read the attached documentation in this paragraph.

But it is usually the best idea to ask "How to use {control} in my {project}" and attach "msdn" to it. MSDN has a best overview to all of the Microsoft products and you can learn almost everything from there. There are many reviews to their overview too. Have a look at this post[^]. They're sharing their views, and the best practices for using the ListView, MVC can be a project template using the ListView.


这篇关于如何在c#中使用mvc使用Listview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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