This question is locked. New answers and comments are not allowed.
I am starting a very large enterprise application with a requirement that we use ASP.NET MVC2. I am relatively new to the ASP.NET arena. The Telerik ASP.NET Ajax controls seem ideal for what we need. However, the primary control we will use extensively is the grid, and there are limitations on what the Ajax grid can do in an MVC application. The Telerik ASP.NET MVC Extensions seem very good, and the grid seems very capable for what we need, but it is lacking a lot of the other Telerik ASP.NET Ajax controls. I have tried to research this and haven't found anything yet. Is it possible to use both Telerik ASP.NET Ajax controls and Telerik ASP.NET MVC Extensions together in the same application? Any thoughts or links would be appreciated.
4 Answers, 1 is accepted
0
Matthew
Top achievements
Rank 1
answered on 06 Nov 2010, 03:34 PM
Yes with some if's and butts. Im currently working MVC 2 and MVC 3 Beta quite successfully with the telerik controls.
Hi Carl.
Here would be a good starting point:
http://www.telerik.com/help/aspnet-ajax/radcontrols-for-aspnet-mvc-overview.html
I have personally used the Editor and Scheduler (also the menu and treeview as well before the MVC variants were available) from the Telerik ASP.NET Ajax Controls. All the others have been excellent since Q1 release.
There are considerations to pay attention to like lack of viewstate, request handling (supplying routes, or changing some things in the web.config) but most can be achieved quite easily.
For some other requirements that demand viewstate and other controls then there isn't anything to stop you from creating a older ASP.NET Forms Page within the same project. MVC - ASP.NET Application
Hope that helps out a bit.
Matthew
Hi Carl.
Here would be a good starting point:
http://www.telerik.com/help/aspnet-ajax/radcontrols-for-aspnet-mvc-overview.html
I have personally used the Editor and Scheduler (also the menu and treeview as well before the MVC variants were available) from the Telerik ASP.NET Ajax Controls. All the others have been excellent since Q1 release.
There are considerations to pay attention to like lack of viewstate, request handling (supplying routes, or changing some things in the web.config) but most can be achieved quite easily.
For some other requirements that demand viewstate and other controls then there isn't anything to stop you from creating a older ASP.NET Forms Page within the same project. MVC - ASP.NET Application
Hope that helps out a bit.
Matthew
0
Carl
Top achievements
Rank 1
answered on 06 Nov 2010, 06:00 PM
Matthew,
Thanks very much for the reply. In this project, we will have 2000+ views and will be using Portable Areas from MvcContrib, several blocks from the Enterprise Library, OpenAccess ORM and Telerik Reporting. Trying to make sure that all of the pieces work together in MVC2 has been a real challenge. I would like to keep the ability for users to select a theme, so keeping that consist across the various areas, controls and extensions is important as well. I did download and run the forum project for using ASP.NET Ajax with MVC, but there were several limitations with the grid control so I dropped back to the MVC Extensions only to get the initial project framework started. As soon as I get a chance I will try to integrate some of the Ajax controls as well. I really like what a lot of them do.
Carl
Thanks very much for the reply. In this project, we will have 2000+ views and will be using Portable Areas from MvcContrib, several blocks from the Enterprise Library, OpenAccess ORM and Telerik Reporting. Trying to make sure that all of the pieces work together in MVC2 has been a real challenge. I would like to keep the ability for users to select a theme, so keeping that consist across the various areas, controls and extensions is important as well. I did download and run the forum project for using ASP.NET Ajax with MVC, but there were several limitations with the grid control so I dropped back to the MVC Extensions only to get the initial project framework started. As soon as I get a chance I will try to integrate some of the Ajax controls as well. I really like what a lot of them do.
Carl
0
Matthew
Top achievements
Rank 1
answered on 08 Nov 2010, 11:51 PM
Ah themes.
That is one of the aspects i've been playing with in respect to MVC Projects.
I've not been too consistent yet, with four approaches below:
I cant say I have done much that has required changing the themes for the telerik controls dynamically yet though. Approach number three is a bit irrelevent in that case. The first two may suit you, if you are storing the user theme selection in a database then approach two may be the most discrete.
Personally I would probably go with point 2 with your site where different view models extend off a generic one. But this would account to a lot of work depending what would would be appearing on each view and its purpose, which leaves point 1 to be the easiest to maintain and implement. Where the Telerik Script Register is extended like below:
A extension method for WebAssetGroupBuilder (warning i havnt tested it)
After which the styles declaration in the masterpage change from and to:
If anyone thinks of a better way of managing the themes then I would love to know.
If you run into any difficulties I'm sure I would like some fun and to try and find a solution for it, as long as I'm not too busy. We've run into some hiccups with MVC too, like Microsoft Reports... we got them to work and with custom paging but alas we are just going to give in and add a route for a ASP.NET Forms Page to help the transition. Im sure as MVC matures them more technologies will be more easily integrated but for now here is to the fun of getting it all to work.
Good luck with the conversion.
Matt
That is one of the aspects i've been playing with in respect to MVC Projects.
I've not been too consistent yet, with four approaches below:
- Firstly declaring and fetching the themes from the RouteValues - Rending in the Masterpage (explained more later on)
routes.MapRoute("Service Route","Owner/{ownerId}/Service/{serviceId}/Page/{pageId}/{themeName}",new{themeName ="sitefinity"});
- Making the Masterpage expect a particular model type / interface. So masterpage themes and settings can be applied though the model - like the menu changing its items depending on the page that is loaded, specific user theme settings ect.
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage<Nyx.Cms.Web.Models.CmsViewerModel>" %> - Toying around with MVC3' (sort of) Theme setting (http://channel9.msdn.com/Shows/Web+Camps+TV/Web-Camps-10-WebMatrix-Beta-2-Themes-Package-Manager-NuPack-HTML-5-templates-and-more), which is part of microsoft-web-helpers. So that the theme folder just needs changing from the controller or route conditions.
- Changing the masterpage through the controller (where each masterpage contains different configs and layouts), but the same content areas -- there is a couple of places in the controller where this can be manipulated.
I cant say I have done much that has required changing the themes for the telerik controls dynamically yet though. Approach number three is a bit irrelevent in that case. The first two may suit you, if you are storing the user theme selection in a database then approach two may be the most discrete.
Personally I would probably go with point 2 with your site where different view models extend off a generic one. But this would account to a lot of work depending what would would be appearing on each view and its purpose, which leaves point 1 to be the easiest to maintain and implement. Where the Telerik Script Register is extended like below:
A extension method for WebAssetGroupBuilder (warning i havnt tested it)
using Telerik.Web.Mvc.UI;using System.Web.Mvc;public static class TelerikAssetHelpers{ public static WebAssetGroupBuilder AddByRouteData(this WebAssetGroupBuilder groupBuilder, ViewContext viewContext) { return AddByRouteData(groupBuilder, viewContext, "windows7"); } public static WebAssetGroupBuilder AddByRouteData(this WebAssetGroupBuilder groupBuilder, ViewContext viewContext, string defaultTheme) { var hasRouteData = viewContext.RouteData != null; var hasThemeRoute = hasRouteData && viewContext.RouteData.Values.ContainsKey("theme"); //expect telerik | sitefinity | windows 7 string selected = hasThemeRoute ? viewContext.RouteData.GetRequiredString("theme") : defaultTheme; switch (selected) { case "telerik": return groupBuilder.Add("telerik.telerik.min.css"); case "windows7": return groupBuilder.Add("telerik.windows7.css"); case "sitefinity": return groupBuilder.Add("telerik.sitefinity.css"); default: return groupBuilder.Add("telerik.sitefinity.css"); } }}After which the styles declaration in the masterpage change from and to:
<%//= Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.sitefinity.css")) %><%= Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").AddByRouteData(this.ViewContext.RouteData)) %>If anyone thinks of a better way of managing the themes then I would love to know.
If you run into any difficulties I'm sure I would like some fun and to try and find a solution for it, as long as I'm not too busy. We've run into some hiccups with MVC too, like Microsoft Reports... we got them to work and with custom paging but alas we are just going to give in and add a route for a ASP.NET Forms Page to help the transition. Im sure as MVC matures them more technologies will be more easily integrated but for now here is to the fun of getting it all to work.
Good luck with the conversion.
Matt
0
Carl
Top achievements
Rank 1
answered on 10 Nov 2010, 04:10 PM
Matthew,
That is great information. It will probably be a week or two before I can really get back on this, but I'll try these options and see what will work best for us.
Thanks,
Carl
That is great information. It will probably be a week or two before I can really get back on this, but I'll try these options and see what will work best for us.
Thanks,
Carl