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

Javascript compression

2 Answers 118 Views
Compression
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 11 Jul 2011, 08:01 PM
Hi!
We have an ASP.NET page with a lot of Rad controls including (Textboxes, Lists, comboboxes) and a RadGrid. I'm trying to improve the performance of the page and currently about 35% of the page size is occupied by the script blocks of Rad controls. Example of the javascript statements are mentioned below and these get repeated for each control. I'm guessing that this gets generated on-the-fly when the control is spitted out to HTML.

Is there a way one could compress/minimize the javascript code on the page? Any help/suggestions would be appreciated.


------------Example Javascript function calls on the page ----------
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadTextBox, {"_focused":false,"_postBackEventReferenceScript":"setTimeout(\"__doPostBack(\\\u0027ctl00$PageContent$woMaint$tbxRateSchedule\\\u0027,\\\u0027\\\u0027)\", 0)","_skin":"WebBlue","clientStateFieldID":"ctl00_PageContent_woMaint_tbxRateSchedule_ClientState","enabled":true,"styles":{HoveredStyle: ["width:50%;", "riTextBox riHover"],InvalidStyle: ["width:50%;", "riTextBox riError"],DisabledStyle: ["width:50%;", "riTextBox riDisabled"],FocusedStyle: ["width:50%;", "riTextBox riFocused"],EmptyMessageStyle: ["width:50%;", "riTextBox riEmpty"],ReadOnlyStyle: ["width:50%;", "riTextBox riRead readonly"],EnabledStyle: ["width:50%;", "riTextBox riEnabled"]}}, null, null, $get("ctl00_PageContent_woMaint_tbxRateSchedule"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadTextBox, {"_focused":false,"_postBackEventReferenceScript":"setTimeout(\"__doPostBack(\\\u0027ctl00$PageContent$woMaint$tbxLoanType\\\u0027,\\\u0027\\\u0027)\", 0)","_skin":"WebBlue","clientStateFieldID":"ctl00_PageContent_woMaint_tbxLoanType_ClientState","enabled":true,"styles":{HoveredStyle: ["width:80px;", "riTextBox riHover"],InvalidStyle: ["width:80px;", "riTextBox riError"],DisabledStyle: ["width:80px;", "riTextBox riDisabled"],FocusedStyle: ["width:80px;", "riTextBox riFocused"],EmptyMessageStyle: ["width:80px;", "riTextBox riEmpty"],ReadOnlyStyle: ["width:80px;", "riTextBox riRead readonly"],EnabledStyle: ["width:80px;", "riTextBox riEnabled"]}}, null, null, $get("ctl00_PageContent_woMaint_tbxLoanType"));
});

2 Answers, 1 is accepted

Sort by
0
Deepak
Top achievements
Rank 1
answered on 12 Jul 2011, 02:42 PM
Any suggestions please?
0
Johny
Top achievements
Rank 1
answered on 13 Jul 2011, 07:18 AM
Hi,

I am not 100% sure but I think Radscriptmanager should help you. Here is what telerik says about it:

"The performance gain of RadScriptManager should be monitored on a remote server, but not in a local development. This is, because the control optimizes the network latency delay when loading the scripts. This comes at the cost of some processor load, because the scripts get combined and compressed on the server."

I hope this helps.

Johny.
Tags
Compression
Asked by
Deepak
Top achievements
Rank 1
Answers by
Deepak
Top achievements
Rank 1
Johny
Top achievements
Rank 1
Share this question
or