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

Optimizing RadControls for MVC

2 Answers 103 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
DGDev
Top achievements
Rank 2
DGDev asked on 09 Apr 2009, 10:17 PM
Hi there guys,
I've recently started a project using ASP.NET MVC and am so far loving every aspect of it. Telerik's controls are surprisingly compatible for the most part, however, I'd like to get advice from the Telerik team as to the best way to optimize RadControls for the MVC framework.

It's obvious that you should set "EnableViewState" = "False" on each control.
I've also noticed that I had to set "EnablePartialRendering" = "False" on RadScriptManager.

My main goal is to reduce the page size and the amount of data coming back from Telerik.Web.UI.WebResource.axd
I'm still getting data set into a hidden ViewState element though. Is there an official "MVC Optimization" blog post or thread?

Much thanks!

-Danny

2 Answers, 1 is accepted

Sort by
0
Dallas Sehlhorst
Top achievements
Rank 1
answered on 10 Apr 2009, 04:06 AM
Hi Danny,

You don't need to set EnableViewState to False, or EnablePartialRendering as the events that create the ViewState are not called/used in ASP.NET MVC.

As for the ViewState still being set from the RadScriptManager, put this in your View and it will disappear (at least it does for me):

<script runat="server"
    public override void VerifyRenderingInServerForm(Control control) 
    { 
    } 
</script> 

I haven't seen a consolidated MVC performance thread, but if you look in the Telerik blogs you will find posts on how to optimize the controls in MVC.  I also find that if you use JQuery instead of the standard Microsoft AJAX your page sizes (and subsequent calls) will be less, and the pages seem more performant.

If you have any other questions, I'd be glad to help.

Thanks,

-Dallas


0
DGDev
Top achievements
Rank 2
answered on 10 Apr 2009, 06:53 AM
Thanks for your help Dallas.
Unfortunately, that bit of code (method override) did not remove the ViewState element.  Also, if I don't set EnablePartialRendering to False, than Firebug reports the dreaded error: "Sys is not defined". Setting it to false fixes that problem.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
DGDev
Top achievements
Rank 2
Answers by
Dallas Sehlhorst
Top achievements
Rank 1
DGDev
Top achievements
Rank 2
Share this question
or