This is a migrated thread and some comments may be shown as answers.

[Solved] Telerik Extensions for ASP.NET MVC vs RadControls for ASP.NET AJAX

6 Answers 222 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 10 Feb 2011, 10:43 PM
Could someone please clearly explain the difference, because despite however much you search the Telerik website, you do not find a clear answer.

I am developing asp.net mvc application and I started using Telerik Extensions for ASP.NET MVC. There seems to be minimal documentation on these controls, as compared to say the RadControls which comes with a downloadable 48mb PDF documentation on controls and applications.

But my ASP.NET MVC application needs AJAX functionality and it doesn't appear to me the Telerik Extension controls have been built to work with Ajax--they can work with it but you need to write it all yourself.

I started trying the Radcontrols, and found through the way both are configured, it seems you can have ONE or the OTHER e.g. not both extension controls and radcontrols. And also, the radcontrols seem NOT built for MVC and do not seem to fit at all with that model.

So the RadGrid has caching but the telerik extensions grid doesn't !?
RadGrid & all controls have plenty of documentation.

So am I missing doco for the extension controls, or are they just poorly documented, and superceded by RadControls.

Finding this increidbly frustrating that I cannot find a clear description on the wbesite what the controls can and can't be used for so I'm left to trial by error and find myself wasting alot of time.

Please explain Teleriks team!

6 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 11 Feb 2011, 09:26 AM
Hi David,

 RadControls for ASP.NET Ajax are based on ASP.NET Ajax and are typically used in WebForms applications. Most of the controls are compatible with ASP.NET MVC and you can check the online documentation with this regard. Have in mind though that Microsoft ASP.NET Ajax (UpdatePanel for example) does not work with ASP.NET MVC.

Telerik Extensions for ASP.NET MVC is our UI suite for ASP.NET MVC applications. It fully leverages the ASP.NET MVC platform and supports all popular features - model binding, validation, multiple view engines etc. The online documentation is available here. The online demos are here. Indeed if you need Ajax capability you need to implement it yourself. You can either use the ASP.NET MVC built-in ajax features or jQuery. This help article explains how. Telerik Extensions for ASP.NET MVC cannot be used in WebForm applications and do not play well with ASP.NET Ajax because of that.

I hope this helps!

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 15 Feb 2011, 12:53 AM
Hi Atanas,

Thank you for your thorough reply.

Your answer begs the question, may I have both rad controls and telerik extensions in the same page?

Before when I was trying - it seems they conflict with each other, as radcontrols does not want <%: %> code in the head, and the telerik extensions require <%: %> in the head.

Thank you
0
Atanas Korchev
Telerik team
answered on 15 Feb 2011, 08:40 AM
Hello David,

 The problem with the head tag is well known and its solution can be found here - wrap the <%: %> block inside a RadScriptBlock control.
In a word it is possible to use both component suites in the same ASP.NET MVC application. However using the MVC suite in a non-MVC application is not supported.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 17 Feb 2011, 06:30 AM
Thank you for pointing me to the correct documentation.


Unfortunately the General Troubleshooting page was unable to help me with this error I stumbled upon fairly quickly...


Example One: renders fine


In View:


    <form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>




<%
   RadGrid1.DataSource = ViewData["Stuff"];
   RadGrid1.DataBind();
%>




<telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="False"  GridLines="None">
   <MasterTableView>
       <Columns>
           <telerik:GridBoundColumn DataField="Omitted" HeaderText="Omitted" />
           <telerik:GridBoundColumn DataField="Omitted" HeaderText="Omitted" />
           <telerik:GridBoundColumn DataField="Omitted" HeaderText="Ommited" />
       </Columns>
   </MasterTableView>
</telerik:RadGrid>
<br />
</form>






In controller:


public ActionResult Index()
        {
            ViewData["Stuff"] = GetAllStuff();
            return View();
        }




Example 2: I add paging. It does not render. I get this error.
Script controls may not be registered after PreRender.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 


Exception Details: System.InvalidOperationException: Script controls may not be registered after PreRender.


Source Error: 


Line 22: <%
Line 23:    RadGrid1.DataSource = ViewData["Stuff"];
Line 24:    RadGrid1.DataBind();
Line 25: %>
Line 26: 


In View:


    <form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>




<%
   RadGrid1.DataSource = ViewData["Stuff"];
   RadGrid1.DataBind();
%>




<telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="False" AllowPaging="True" GridLines="None">
   <MasterTableView>
       <Columns>
           <telerik:GridBoundColumn DataField="Omitted" HeaderText="Omitted" />
           <telerik:GridBoundColumn DataField="Omitted" HeaderText="Omitted" />
           <telerik:GridBoundColumn DataField="Omitted" HeaderText="Omitted" />
       </Columns>
   </MasterTableView>
</telerik:RadGrid>
<br />
</form>


Controller code did not change.
0
David
Top achievements
Rank 1
answered on 17 Feb 2011, 06:40 AM
Stack Trace: 

[InvalidOperationException: Script controls may not be registered after PreRender.]
   System.Web.UI.ScriptControlManager.RegisterScriptControl(TScriptControl scriptControl) +432555
   Telerik.Web.UI.RadDataBoundControl.RegisterScriptControl() +97
   Telerik.Web.UI.RadDataBoundControl.ControlPreRender() +15
   Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e) +43
   System.Web.UI.Control.PreRenderRecursiveInternal() +103
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +8901398
   System.Web.UI.ControlCollection.Add(Control child) +79
   Telerik.Web.UI.GridPagerItem.InitializePagerItem(GridColumn[] columns) +21751
   Telerik.Web.UI.GridPagerItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +164
   Telerik.Web.UI.GridTableView.CreateTopPagerItem(Boolean useDataSource, GridColumn[] copiedColumnSet, Boolean isPagingEnabled, GridTHead thead) +96
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +810
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +660
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +66
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +128
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   Telerik.Web.UI.GridTableView.PerformSelect() +16
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.GridTableView.DataBind() +256
   Telerik.Web.UI.RadGrid.DataBind() +87
   ASP.views_equipment_index_aspx.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in c:\Dev\Asset Management\DAT\Views\Equipment\Index.aspx:24
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +8696253
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Dev\Asset Management\DAT\Views\Shared\Site.Master:45
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +56
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060
0
Atanas Korchev
Telerik team
answered on 17 Feb 2011, 10:49 AM
Hi David,

Not all features of RadControls for ASP.NET Ajax work in ASP.NET MVC. Those are all features which require postback, ViewState or integration with ASP.NET Ajax (UpdatePanel etc). I suggest you check the known limitations help topic with this regard.

The built-in RadGrid pager relies on postbacks hence it will not work in ASP.NET MVC unless you add a <form runat="server"> in your view and nest the grid inside of it. However adding the <form runat="server"> makes your view a regular ASP.NET page.

RadControls for ASP.NET Ajax were implemented with ASP.NET Ajax and WebForms in mind. Using them inside an ASP.NET MVC application is possible but has its limitations - a lot of features will not work in ASP.NET MVC.

Telerik Extensions for ASP.NET MVC is the recommended product for ASP.NET MVC development.

Regards,
Atanas Korchev
the Telerik team
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
David
Top achievements
Rank 1
Share this question
or