views:

359

answers:

2

I have a pretty big web application that I created last year using ASP.NET webforms. It has two parts: Admin and Client (each one a project inside a single solution). Admin logs in as you would expect and manages the clients. Clients log in and manage themselves. SQL Server back end. It relies heavily on MasterPages and LINQ. It has 2 class libraries, one for my methods (authentication, security, encryption, etc.) and another with dbml files for linq that both admin and client project reference.

Now I really want to convert this to MVC 2. I know I'll have to rewrite the front end (not a problem, looking forward to it). I can reference my current class libraries and modify them as I need. My main concerns are my forms and controls. I'd really like to stay away from the major asp controls and use jquery for everything if possible (especially the presentation layer. I'm just not sure how to go about doing this. I was also told jquery is great for 'parsing and updating the DOM' but I've never done this either and not sure where to start (why do this over LINQ?).

Another issue I struggled with was the size of my main table. It has 109 fields in it, and my customer thinks all of them need to be available on screen (or as many as possible, especially in the grid). I had to break up my entry/edit form into 5 tabs (all web controls). My grids have sorting, grouping, export to excel, etc... I would really like to find a grid that lets you inline edit individual cells when double clicked. Would it be better to use jquery for grids? I can break that large table into relational tables if needed (probably will do that anyway).

Any advice from anyone who's done similar will be greatly appreciated. I just bought the book "Pro ASP.NET MVC 2 Framework, Second Edition" and I have a great jQuery ebook I'm working with.

Thank you guys!

EDIT: Should have mentioned I used Telerik WebControls for my previous web forms project so I'm familiar with them. I had no idea their MVC suite was free (I've paid quite a bit for the webform controls).

+2  A: 

For grids I can recommend the free Telerik mvc controls. They have good support for ajax binding paging, sort, edit, parent-child etc.

This combined with a few widgets from jQuery ui (tabs, dialog) should put you on the right track as far as your presentation layer is concerned.

redsquare
Great recommendations! Can you elaborate on how to parse and update the DOM using jquery in regards to connecting to the database? I'm not understanding the relation between the two.
drpcken
What is the best way to handle data access? Right now I have a Class Library with my Linq to SQL DBML file in it that I reference. Would I just do that the same way? Or would it go in the Model? I'm waiting to get my book so I'm trying to wing it without a book right now. THANKS!
drpcken
Telerik Grid for MVC can bind directly to data in the MVC View Model. Check out the examples online: http://demos.telerik.com/aspnet-mvc/grid/serverbinding. For more general questions about data architecture, I'd encourage you to look at some of the existing ideas on StackOverflow or opening a new question.
Todd
+1  A: 

Adding to RedSquare, the Telerik Extensions for ASP.NET MVC are free and open source (under GPLv2). That essentially means the Extensions for free for "free" projects (projects you're not trying to sell). If you're trying to sell and make money from your software, we have a commercial license, too, to support that.

Today, the Extensions for MVC include 8 extensions: Grid, Calendar, DatePicker, Menu, NumericTextBox, PanelBar, TabStrip, and TreeView.

Additionally, 3 new Extensions are available in beta: Editor, ComboBox, and Window. (Official release towards the end of August.)

The goal of the Extensions is to make it easier to build rich MVC Views, similar to what you've done in the past in WebForms. MVC is very different than WebForms, though, so be careful when making the transition to avoid the "traps" of thinking in WebForms mode. For example, there are no PostBacks or ViewState in MVC, so some things require more deliberate code in MVC.

Finally, as a word of caution for "pure" JavaScript components, remember that they do not support any scenario where JavaScript is disable or not executed (common examples: web crawlers, accessible browsers). If accessibility or SEO are concerns, Server + Client UI controls like the Telerik Extensions can be a bonus.

Hope that helps.

Todd
Can it do inline editing of a single cell? Say I double click a cell in the grid and it edits just the cell? I've been trying to do this for ages. Thanks for the response!
drpcken