context.Response.ContentType = "image/jpg"导致
使用asp.net处理图像: <%@ WebHandler Language="C#" Class="MakeImage" %> using System; public class MakeImage : IHttpHandler { } 使用IE8出现如下错误: 无法显示 XML 页。 使用 样式表无法查看 XML 输入。请更正错误然后单击 刷新按钮,或以后重试。 文本内容中发现无效字符。处理资源 'http://localhost:7151/WebOne/MakeImage.ashx' 时出错。 而用firefox和chrome测试却并未报错,纠结了老半天才发现原来是设置了context.Response.ContentType = "image/jpg"的原因,遂将context.Response.ContentType = "image/jpg"语句删除,IE8打开页面显示成功!但是在firefox、chrome里打开却出现了乱码。 随后在网上找原因,原来是”image/jpep“而不是“image/jpg",改动后各浏览器测试良好 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |