Telerik Extensions for ASP.NET MVC - Performance Implications - asp.net-mvc

I've used quite a bit of the Telerik RadControls for AJAX, and though I've been pretty happy with the controls, I've found that the performance has been less than stellar over traditional controls.
I'm wondering what the performance implications would be (that you might know of) with regards to the MVC Extensions over traditional jQuery libraries (Telerik MVC Grid VS jqGrid for example).
Basically, how well does Telerik MVC Extensions perform?
on a side note: does the Telerik MVC Extensions grab a copy of the jQuery library to use, or am I responsible for adding it to my page for it to work? I'd be a happy guy if I'm the one that has to do this instead of the extensions doing it.

First I need to put some disclaimer as I am one of the developers of Telerik Extensions for ASP.NET MVC. My opinion is obviously biased :)
What are your requirements? How many rows do you intend to show in the grid? How many records do you have in the database? I have tested the grid with 100k db records and 10 items per page. Performance was very good.
By default the extensions include jQuery-1.4.2.min.js but you can prevent this and include it yourself:
<%= Html.Telerik().ScriptRegistrar().jQuery(false) %>

Displaying < 100 rows, which I consider a pretty usable grid size, is probably pretty fast using any Javascript grid. I'd say your bottle neck will be data access unless your trying to display 100,000 rows of data.
The example here, http://demos.telerik.com/aspnet-mvc/Grid?theme=vista, has > 8300 records and is pretty snappy.

Related

Is MVC Framework ill-equipped for rich page design?

Just to prefix this question, I've decided to take a look at moving our works old legacy systems (40+ programs from vb6, vba, vb.net to c#.net) into two separate systems using the same DAL (barcoding terminals and one web based system) as I spend most my day fixing crummy or non existant business logic in 15 year old vba programs. I've recently built an entity framework model complete with fluent validation and couldn't be happier with it after using it for a bit.
The small team is familiar with webforms (but not very) but the last few days I've explored MVC Razor. I was loving MVC Framework until I tried to start trying to add more functions onto the same page and then it seemed arbitrarily hard to replicate our a recent system I put in a webform. Before, I would eager load a customer and all it's child entities and then bind that to single page for the customer so they could access everything (which is what they wanted), it works okay and isn't slow. From this single page I could edit all their account details/contacts/emails/phones/jobs.
All the examples I've done and seen in MVC handle a single update, a single edit etc but surely you can't separate out every single action into a new view/page? I can pass a rich model through to the view in MVC, but then its a pain trying to update all the different child entities.
This is probably the exact design that MVC wasn't designed for maybe, which is okay, I'm willing to adapt it if MVC will be a better platform going forward, but how are you meant to handle adding this complexity in? Some methods I've seen:
Lots of partial views? passing child info to them (or the id and lazy loading it)?
I've seen methods that wrap multiple <forms> around everything and handle actions that way.
Separate pretty much every task out
If the solution is more lightweight and easier to maintain I'll go research whatever I need to I just wanted at an earlier stage to see if I'm wasting my time. Any pointers to the correct questions I should be asking would be greatly appreciated.
ASP.NET MVC is neither more or less better equipped to deal with complex pages than any other technology out there.
Certainly, MVC requires more low-level work than a Web Forms app, with no direct binding support, but in most cases this is a good thing and provides much more flexibility in how your page is rendered.
One of the whole ideas of MVC is to give you more control over things, but that control leads to requiring more knowledge and more effort on your part in most non-trivial cases. MVC provides a number of tooling functions to speed up trivial work (like creating standard table based CRUD) but when you have complex models, you will have to do much of the work yourself.
This is not that MVC is "ill suited" for it, but just that control and flexibility has a trade off with more responsibility on your part.
In your case, you simply create a view model with all the fields you want. Then, you create your form to edit those fields. In your controller, you will need to unflatten that view model and create or update the necessary records in the database. It's not difficult, but it's more work than WebForms databinding.
You could look into more advanced tools (commercial) for MVC, such as Telerik's tools, which have developed more of a databinding like interface, but MVC is not a drag-n-drop technology, and requires you to hook things up and write the various logic for what is done.
If you need drag-n-drop, databound functionality, then no.. MVC is not the correct technology. But then WebForms requires you to accept many compromises as well, and ties your hands in many ways.
You could use partial views, however I seldom use them. I prefer to instead use Editor/DisplayTemplates as these take care of naming your form fields correctly, even for collections and complex objects. PartialViews tend to have lots of gotchas if you aren't careful. I pretty much only use them as fancy includes, or when using Ajax.
I'm not sure what you meay by "wrap multiple <forms> around everything`. You cannot nest forms in HTML, it's not legal. If you mean place a form around each row of a table, that isn't valid html either in most cases (it's not legal to put a form in a between the table and the tr).
It would help if you had a specific problem that you could ask about, vague objections don't help us solve your issue.
You can accomplish anything in MVC that you can in WebForms. The difference is MVC will usually require you to write more code as it doesn't really offer you any "controls" to drop on your page.
In WebForms, it's easy to create a master/detail view with a GridView, FormView and then wrap everything in an UpdatePanel for automagical AJAX support.
In MVC, while you do have helpers like the WebGrid and AjaxHelpers extension methods, creating views and/or pages requires more understanding of how things work to get the desired functionality. When I start a new MVC project, here's what I include:
Backbone.js - client-side "ORM" that performs CRUD operations
against RESTful* APIs
Knockout.js - client-side view models and
real-time data-binding for your views
Knockback.js - wraps
Backbone models in Knockout view models
Using these three frameworks, you can quickly create powerful single-page apps using MVC and WebAPI.

MVC vs ASPX dynamic page render

I have a CMS website written in aspx 2.0 that allows users to build up pages by dropping controls on a page and setting properties (reflection on the server side) and events (client side js). The render engine knows what property to call on each control to find out what to save into the database. I went through all the pitfalls of control re-hydration and lack of proper ids on the controls and really struggled to make the solution SEO friendly which currently is partial at best. Also suffer from viewstate getting huge so I have started to look at MVC as a better way forwards for the next version. The final design of the page is only set when the user decides to promote it live, and may make many changes per day.
A typical page may have many textbox controls, radio button groups, checkbox groups, dropdownlists and images. Also we have a few of our own controls that we reflect at runtime into the solution.
From my initial research into MVC, this looks to have been written to avoid these types of issues and not try to hide the html which looks very promising as well as giving final markup that is much more cross browser friendly.
Now the question - since the requirements are to generate dynamic pages with dynamic html controls, is this a step too far for MVC and I should stick with ASPX, or is there a way to generate the dynamic content which would be suitable for a non technical person to be able to do?
Really appreciate any guidance before I jump in with both feet :)
Thanks
Mark
I'm assuming by aspx 2.0 you mean WebForms? It's really not a question of if MVC is capable of doing what you need - it is capable, and in
my opinion it's more capable. However There are some major differences between WebForms and MVC check out this post for more on that topic: MVC versus WebForms.
I hope this helps. Without more information on exactly what you're trying to accomplish, there's not much more I can say. Consider asking more specific questions with some code examples.
Some of the main advantages of MVC: Clean HTML, No ViewState written on the page, easier to support html5 and thus SEO as well.
For me, since I used MVC 3 years ago I don't even want to touch WebForms thesedays.
Btw, if you want CMS + MVC, why not use Orchard rather than building yourself?
http://paulmason.biz/?p=118

ASP.Net MVC 3 Grids

I see that there is the Telerik Grid, jqGrid and WebHelper WebGrid as part of the framework. Am I missing any others?
Which one works best on a commercial application with thousands of rows and master/detail relationships for ASP.Net MVC 3?
I have used the Telerik MVC grid in production. Take a look at the grid at an online Diamond store. It works the same with even 50k+ rows as it only sends the current page to the browser + it has many cool features like Filters, Ajax binding etc.
No idea on the master details front. You could find more info about it on Telerik's Site
there is also grid supplied by mvccontrib. I personally use telerik grid having some cool features and scale for large data Q3 2010 has some good improvements such as inline editing etc. For MVC 3 grid i am waiting for rtm of mvc 3 coming in January
If you're using Telerik for a commercial project, then you will need to buy it. Check this link: http://www.telerik.com/products/aspnet-mvc/getting-started/licensing.aspx.
We're using the jQuery in our project, so the jqGrid is most suitable for us. It's powerfull, has a lot of plugins and completely free, but little bit more complicated in use than Telerik.
jqGrid usage example:
[view]
http://xenta.codeplex.com/SourceControl/changeset/view/11214#118453
[controller]
http://xenta.codeplex.com/SourceControl/changeset/view/11214#118416

Which datagrid to use for ASP.NET MVC2 project?

I am developing a commercial MVC2 app that requires a grid that has callback update in some form to support 10,000+ rows. It should also support relatively rich content (icons, multiline descriptions etc). Although it requires the usual paging/scrolling/sorting features it does not need support for grouping. So nothing that special.
The commercial grids I looked at were Component Art and Telerik which both look pretty good but may be a little OTT for what I need. They are also $800 and $999 respectively (1 developer).
I've also looked at jqGrid and the grid from MvcContrib. These appear ok but for a commercial app I am concerned that these may be risky options - though could be wrong there.
I'd really appreciate any views/exprience on either the above grids or perhaps you can suggest a better option/approach.
FYI I am using EF4 and C#.
I have quite a bit of experience with jqGrid, the grids from DevExpress and telerik, as well as ExtJS. By far, my favorite of the bunch is jqGrid. I'm not concerned with lack of support or the project going away. They had just recently introduced a redesigned grid for use with MVC: http://www.trirand.com/blog/?p=639
telerik and DevExpress are both excellent in their own way. A friend of mine has had issues with the eventing model of the telerik grid, and I've experienced quite a bit of 'html bloat' from the DevExpress grid. telerik has great support for doing things like reordering columns on the client side, while the DevExpress grid requires a call back to do this.
ExtJS is wonderful, but I really feel that it is a very heavy JavaScript grid. Performance in IE can be dreadful with the ExtJS grid. It generally performs well if you do not have a lot of columns, or do not try and put more than one grid on a page. You'll want to definitely avoid putting the ExtJS grids into Tab controls, as all sorts of issues arise when the grid is rendered to a non visible element.
We've actually just recently decided to switch all of the grids used in our reporting system over to telerik's Silverlight grids, which perform beautifully compared to their JavaScript counterparts.
Hope this helps, and good luck.
Honestly, you can develop your own with MVC rather easily giving you all that you need. Though I suppose if you need something quick that works, the MvcContrib grid is great.
give a look to the datagrid of the MVC Controls Toolkit. It appears quite flexible. It allows editing, deletions, insertions and paging. Moreover it is really easy to move the changes to a DB in the controller. Look at it here.
There is a DevExpress grid much the same as Telerik which again might be over the top for you. However you can buy the grid on it's own rather than the whole suite although it may not be worth doing that since the grid is almost half the price of the suite.
My last shot at components for ASP.NET MC was not succesfull. Its so much harder to have a controll for MVC then for old school ASP.NET.
the routing the controll expects has to mapp nicely to the routing of your application
things get much harder when you have more then 1 grid on the page
if the controll has to work for non-Javascript enabled clients your choices are even more limited
if the back button of the browser needs to be working your choice is even more limited
In my case it turned out that it was much better to use plain html and jquery to realise paging, sorting and filtering for a table. I would draw the line if your site is more a public website (like mine) or an application that has a web frontend.
We use the ExtJS grid in out ASP.NET MVC project.
http://www.extjs.com/deploy/dev/examples/grid/array-grid.html
I recently research about this and the winning was jQgrid for performance is the Best!

Replicate Webforms GridView in ASP.NET MVC

Is there a realistic way to implement a webforms stylegridview in ASP.NET MVC, with inline editing?
I have found various solutions to get a grid with inline editing working in MVC using JQuery add-ins but so far they have been very messy, require an unrealistic amount of work and that all gets worse when you want to add client and server side validations.
I develop a lot of sites that have fairly extensive administration sections to them. So far I have spent longer doing one page with MVC (which still does not work) than I would have doing the whole administration section of a site. Grids with inline editing work really well for somethings, say maintaining a list of countries and marking some as active or inactive. I know I can easily make this open a "details/edit" page, or even handle it with an AJAX popup, but neither of these options provides as clean a user experience as inline editing for things this simple.
Has anyone found an easy way to achieve inline grid editing or do I need to go for a hybrid MVC / winforms site (which I really didn't want to do).
Thanks
Andrew
The Java Script Framework Ext JS has some good support for all different types of grids. This is something you could easily use with ASP .NET MVC, I'm sure there are some other solutions both client and server side out there as well.
I have had luck with incorporating Dynamic Data with ASP.NET MVC for just this very purpose. This hybrid solution can give you all the perceived benefits of a foward facing MVC site while giving you a quick and easy way to create CRUD functionality on all your data for admnistrative purposes. To be honest, if your user base isn't that large, designing the whole application in Dynamic Data is a legitimate option, especially once you get comfortable enough with it to use it past its basic "scaffolding" abilities.
As far as actually finding a packaged solution for providing ASP.NET GridView functionality in ASP.NET MVC, good luck. I have yet to find any solution that doesn't require some sort of melding with javscript frameworks or incomplete solutions like those offered by MVC Contrib. If you do find one, please let me know.

Resources