如何压缩 ASPX 页面?
我按照这里的示例来压缩我的页面:
http://www.codeproject.com/ KB/aspnet/Aspx_Compression.aspx
但我得到的结果是一个充满奇怪字符的页面:
���I�%&/m�{J�J��t��
$�@��������iG#)�*��eVe]f@�흼 {����{����;�N'
不确定该代码有什么问题?
我在 Page_Load 和 Page_Render 事件中尝试了代码。
有什么想法吗?
谢谢,
更新: 只是更新;我的代码错了!使用 FireBug/Net 选项卡对其进行调试,发现添加了错误的标头。
I followed the sample from here to compress my page:
http://www.codeproject.com/KB/aspnet/Aspx_Compression.aspx
But the result I get is a page full of odd characters:
���I�%&/m�{J�J��t��
$ؐ@�������iG#)�*��eVe]f@�흼��{����{����;�N'
Not sure what's wrong with that code?
I tried the code both in Page_Load and Page_Render events.
Any idea?
Thanks,
Update:
just an update; my code was wrong! debugged it with FireBug/Net tab and it was revealed that a wrong Header was added.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 SquishIt 压缩 CSS 和 JavaScript。这是一个非常好的工具,
请参阅 SquishIt 上的一篇很好的 文章
您可以从 GitHub 下载 SquishIt
Use SquishIt to compress the CSS and JavaScript. It is a very good tool
See a good article on SquishIt
You can dowload the SquishIt from GitHub