Implement Asp.Net Ajax Controls in MVC - asp.net-mvc

I was reading telerik post
About Telerik ASP.NET AJAX Controls in MVC project. According to them we can implement Telerik AJAX control in Asp.Net MVC. So my question is can we implement ASP.Net Ajax control in my Asp.Net MVC Project.
If Yes how could it should be done?

Yes you can, but you must be aware of the limitations. You can read more from their documentation on Telerik.com; they have some documentation on this process. I would recommend using the MVC helpers where possible.

Related

Custom Asp.net server controls that will work in MVC and Web Forms?

Is it possible to develop controls that will work in both Asp.net Web Forms and MVC?
It seems that we're heading for a situation where we now have to maintain another set of code for MVC over and above the code being maintained for Silverlight and Web Forms and heaven knows what else.
It is possible, but not pretty. MVC does not have the ViewState.

How to access Page.Header.Controls in ASP.NET MVC 2?

Is there a way to access Page.Header.Controls in ASP.NET MVC 2?
Edit
I want to create a helper which can manage scripts.
Yesterday, after I asked this question I discovered, that ViewPage and ViewUserControl has Page property.
I think this allows us to access Page.Header.Controls.
No, Page.Header doesn't exist in ASP.NET MVC. Header is the <head runat="server> control in ASP.NET Web Forms. ASP.NET MVC doesn't use controls like that.
If you want logic in the <head> of your HTML, you have to go about it the ASP.NET MVC way, by using code in your view or your master page.
The Page property of a ViewPage comes from the fact that Web Form Views are bastard Web Forms. ASP.NET MVC normally doesn't use any bits of the Web Forms beside the code-in-front and the markup, but via various unsupported haacks you can abuse it into letting you use other Web Forms stuff. Don't do it.

AJAX Toolkit for ASp.net MVC

Is there any ajax toolkit for asp.net MVC
As MVC does not have ViewState or the Web Forms postback model the AjaxControlToolkit will not work with it.
There is a project to do this (http://mvccontroltoolkit.codeplex.com/) but it's not yet released.
There are numerous blogs where have got different controls working but to be honest I'd suggest looking at jQuery and its plugins (http://www.jqueryui.com/). MVC lends itself far more naturally to these, it is not control-based.
Here's another resource talking about this: http://www.hanselman.com/blog/ASPNETMVCPreview4UsingAjaxAndAjaxForm.aspx
In addition, ASP.NET MVC lends itself quite easily to making your own amazing ajax controls, especially when combined with jQuery.
The emphasis in ASP.NET MVC is more on HTML and client-side code when talking about user-control similar to those in the AJAX Toolkit - you may like to check out the excellent http://www.jqueryui.com/ for some good client-side controls.

Quickest way to add a DataGrid to an MVC.NET app: ASP.NET AJAX or jQuery?

I have an ASP.NET MVC application which uses plain HTML. I quickly need to add tabs and a datagrid to it. I've been evaluating ASP.NET AJAX and jQuery, but am running out of time to make a decision.
If I needed to add these 2 features quickly, how should I proceed? ASP.NET AJAX or jQuery?
If you are adding a grid to MVC, your best bet is JQuery. The ASP.NET DataGrid is not going to work with MVC, because MVC doesn't support postbacks. The ASP.NET AJAX tabs may not work either.
Here is a plugin for the tabs:
http://stilbuero.de/jquery/tabs_3/
And here is a plugin for the Grid:
http://www.trirand.com/blog/
If you want to roll-your-own server-side GridView control for MVC, see here:
http://stephenwalther.com/blog/archive/2008/06/25/asp-net-mvc-tip-9-create-a-gridview-view-user-control.aspx
There is also a Grid Component in MVCContrib:
http://mvccontrib.codeplex.com/Wiki/View.aspx?title=Grid&referringTitle=Home
jQuery UI Extensions for ASP.NET MVC contains tabs:
http://jmvcui.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33636

Use ASP.NET Web Forms UserControl in ASP.NET MVC?

I've been tasked with making a prototype web application, and i'm debating between using ASP.NET WebForms or the new ASP.NET MVC.
There is a commerical ASP.NET UserControl that i would like to use that gives me 95% of the functionality i need (and it does it in an AJAX-y fashion). But i've heard that since ASP.NET MVC doesn't use ViewState, it can't run these WebForms-based controls.
So, is that true or false?
I'd really like to use this commerical UserControl, but i want to use ASP.NET MVC if i can, and only if ASP.NET MVC is not going to give me much trouble when trying to use the WebForms-based control.
Traditional WebForms and MVC aren't mutually exclusive; you could run both of them in the same site. For an explanation of how to make this happen, see this post by Scott Hanselman.
So you could, for example, create WebForms-based page(s) to leverage the commercial control, and use MVC for everything else. You could also set up a simple test to see if the control can operate without ViewState -- making it OK to use in MVC -- and fall back on the hybrid approach.
It probably won't work. There is no viewstate, postbacks (in the Webforms sense) or page lifecycle which most commercial controls rely on in some fashion.

Resources