如何缩小ASP.NET生成的javascript

时间:2013-04-12 06:37:29

标签: javascript asp.net minify

我知道很少有javascript文件压缩器/缩放器。最近我使用的是pagesped和Yslow,它们认为应该缩小所有java脚本。因此我们也缩小了所有内联脚本。我们仍在接收minify java脚本建议。 验证后我发现ASP.NET生成的java脚本用于控件和其他东西。我想知道如何缩小ASP.NET生成的脚本[将会]。据我所知,我们不能做这个预建。 IIS中的任何设置都指定ASP.NET生成缩小的js?

我已关闭调试模式。它仍然没有缩小

请帮助我......

为我的网站生成的部分脚本是:

function WebForm_PostBackOptions(eventTarget, eventArgument, validation, validationGroup, actionUrl, trackFocus, clientSubmit) {
    this.eventTarget = eventTarget;
    this.eventArgument = eventArgument;
    this.validation = validation;
    this.validationGroup = validationGroup;
    this.actionUrl = actionUrl;
    this.trackFocus = trackFocus;
    this.clientSubmit = clientSubmit;
}
function WebForm_DoPostBackWithOptions(options) {
    var validationResult = true;
    if (options.validation) {
        if (typeof(Page_ClientValidate) == 'function') {
            validationResult = Page_ClientValidate(options.validationGroup);
        }
    }
    if (validationResult) {
        if ((typeof(options.actionUrl) != "undefined") && (options.actionUrl != null) && (options.actionUrl.length > 0)) {
            theForm.action = options.actionUrl;
        }
        if (options.trackFocus) {
            var lastFocus = theForm.elements["__LASTFOCUS"];
            if ((typeof(lastFocus) != "undefined") && (lastFocus != null)) {
                if (typeof(document.activeElement) == "undefined") {
                    lastFocus.value = options.eventTarget;
                }
                else {
                    var active = document.activeElement;
                    if ((typeof(active) != "undefined") && (active != null)) {
                        if ((typeof(active.id) != "undefined") && (active.id != null) && (active.id.length > 0)) {
                            lastFocus.value = active.id;
                        }
                        else if (typeof(active.name) != "undefined") {
                            lastFocus.value = active.name;
                        }
                    }
                }
            }
        }
    }
    if (options.clientSubmit) {
        __doPostBack(options.eventTarget, options.eventArgument);
    }
}

0 个答案:

没有答案