views:

122

answers:

2

I have come across the ASP.NET ready made controls like grid, repeater... etc.

For example while dealing with GRID i remember following facts,

ASP.NET V1.1 has DataGrid with "virtual row count" which is heavily used for custom paging which is need of big sites to perform well.

ASP.NET V2.0 added the GridView with all sort of cool features but also split the DataSource parts as different component. Also "virtual row count" is not supported and for pagination to be done DataSource control is need to be used.

After all these thing i thought that ASP.NET control are not made to be used as is for the development.

Please let me know whether i am right or wrong? Also if you think i am wrong PLEASE provide inputs/links which can help me come out of this thinking of mine.

+1  A: 

I've never had a problem using these controls. I find that they have the same advantages and disadvantages as any set of controls - native or third party. If they do 100% of what you need them to do, then fantastic. If they don't give you 100%, and don't give you events or virtual methods to override, then you're stuck and you'd need to go back to more fundamental controls and do a little programming of your own. I always found the repeaters and lists to be very handy in that respect.

Neil Moss
+1 I agree about using the right controls in the right circumstances. There is no substitute for experience with these controls, but if you don't have it, SO is where you go to ask the experts. @Anil Namde asked this question: "Are ASP.NET readymade controls really production worthy". Not "Should I switch to ASP.NET MVC".
Daniel Dyson
+2  A: 

The mjority of the out-of-the-box asp.net controls are very simple, easy to use and they do that they claim to do, reliably. Many people have had issues with the GridView control, particularly with regard to preformance and size of ViewState. Performance issues have only partly been resolved through the use of AJAX.

I agree with @Neil Moss about the Repeater control. It is very flexible and it outputs what you tell it to. For grids, take a look at the JQuery plugin JQGrid. It has none of the performance issues and a lot of the powerful features of many thrid party custom grids. http://www.trirand.net/demoaspnet.aspx

Also, the ListView control is a very good alternative to the GridView as it provides many of the databinding, selection, paging, sorting, modifying features of the gridview (see here) but gives full control over the output template. Here is a good series of articles on the ListView

Although I am a strong advocate of using ASP.NET MVC, there is a considerable learning curve required to do this and the change in mindset required to work properly in the MVC way should not be underestimated.

Daniel Dyson
-1: It's fundamentally flawed to use xmlhttprequest to "solve" performance problems; the problems are still there. Also, the controls hide and expand upon a fundamentally simpler and easier concept; HTTP 1.1. Picture an elephant standing on one leg; there's your image. The learning curve for MVC is much smaller than for web forms. WebForms leads to handicapped programmers who can't code javascript or more http-like web sites if their life depended on it.
Henrik
I have no idea what your reference to an Elephant means, but it made me laugh. My assumption was that they already had ASP.NET experience. In that case their problem would be solved a lot quicker and easier by improving on what they know already. Some of us are working on projects containing 10 year old code. A mixture of classic asp, ASP.NET and everything else that has come out in the last decade. Suggesting that the user just switch to MVC is a little narrow minded when they asked a specific question and didn't even mention MVC. They have only mentioned up to ASP.NET 2.0 in their question.
Daniel Dyson
Elephants ;). Well, it's true what you say, but I don't think your answer is the answer. To me he's asking a generic ASP.Net question.
Henrik