Javascript compression

3 posts, 0 answers
  1. Deepak
    Deepak avatar
    2 posts
    Member since:
    Jul 2011

    Posted 11 Jul 2011 Link to this post

    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. Deepak
    Deepak avatar
    2 posts
    Member since:
    Jul 2011

    Posted 12 Jul 2011 Link to this post

    Any suggestions please?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Johny
    Johny avatar
    80 posts
    Member since:
    Aug 2008

    Posted 13 Jul 2011 Link to this post

    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.
Back to Top