- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试对某些 .css 和 .js 文件使用压缩包。我的包配置如下:
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/Modernizr").Include(
"~/Scripts/modernizr.js"
));
bundles.Add(new StyleBundle("~/TemplateContent").Include(
"~/Content/bootstrap.css",
"~/Content/bootstrap-responsive.css",
"~/Content/prettyPhoto.css",
"~/Content/prettify.css",
"~/Content/flexslider.css",
"~/Content/iview.css",
"~/Content/style.css",
"~/Content/default.css"
));
bundles.Add(new StyleBundle("~/AppContent").Include(
"~/Content/bootstrap-tablesorter.css",
"~/Content/animate.css",
"~/Content/font-awesome.css",
"~/Content/jcarousel.css",
"~/Conten/overwrite.css",
"~/Content/sequence.css",
"~/Content/sequence.ie.css",
//more styles
));
bundles.Add(new ScriptBundle("~/TemplateScripts").Include(
"~/Scripts/modernizr-*",
"~/Scripts/jquery.js",
"~/Scripts/raphael.js",
"~/Scripts/jquery.easing.1.3.js",
"~/Scripts/bootstrap.js",
"~/Scripts/google-code-prettify/prettify.js",
"~/Scripts/jquery.elastislide.js",
"~/Scripts/jquery.tweet.js",
"~/Scripts/jquery.prettyPhoto.js",
"~/Scripts/jquery.flexslider.js",
"~/Scripts/iview.js",
"~/Scripts/jquery-hover-effect.js",
"~/Scripts/animate.js",
"~/Scripts/custom.js"
));
bundles.Add(new ScriptBundle("~/AppScripts").Include(
"~/Scripts/jquery.ticker.js",
"~/Scripts/jquery.contenthover.js",
"~/Scripts/jquery-ui-1.10.3.js",
"~/Scripts/datetimepicker.js",
"~/Scripts/jquery.metadata.js",
//more scripts
));
BundleTable.EnableOptimizations = true;
}
当我将应用程序发布到服务器(godaddy 共享虚拟主机)时出现问题,我确实得到了缩小的输出,但我在这些输出上收到 403 错误。
如果我设置
BundleTable.EnableOptimizations = false;
文件没有缩小,但页面有正确的行为。
最佳答案
原来是 ASP.NET 表单例份验证。根据this ,包的名称不应是现有目录。而且,表单例份验证拒绝访问那些不允许进入 web.config 的目录。
我不知道这些包会创建它们自己的目录,所以我基本上为这些目录添加了位置标签(即使它们实际上不在解决方案中)。
所以基本上...
对于所有以前的包名称,我添加了“~/bundles/”,然后在 web.config 中创建了以下位置标记:
<location path="bundles">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
关于c# - 发布 WebForms 应用程序时 Bundle Minification 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19908806/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!