Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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 :)
Posted
Comments
Sergey Alexandrovich Kryukov 10-Nov-14 12:42pm    
What idea? Just read MSDN documentation on this control.
—SA

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[^]
 
Share this answer
 
Comments
Maciej Los 10-Nov-14 16:38pm    
+5
Manas Bhardwaj 10-Nov-14 16:41pm    
thx ;)
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.
 
Share this answer
 
Comments
Manas Bhardwaj 10-Nov-14 14:58pm    
Well explained. my 5!
Afzaal Ahmad Zeeshan 10-Nov-14 15:09pm    
Thanks alot Manas brother. :-)
Maciej Los 10-Nov-14 16:44pm    
+5!
Afzaal Ahmad Zeeshan 10-Nov-14 16:45pm    
Thanks Maciej. :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900