我使用javascript/jquery来填充html网页。在IE浏览器工作正常,但在Firefox或Chrome当我点击只有链接图像不显示任何地方显示的图像:如何使用javascript来使用asp.net图像缩放器
http://localhost:12240/ImageResize.aspx?imgsrc=images/test.jpg&width=100
使用JavaScript我创建这个网站码:
<div class="item related-padding">
<div class="item-container item-0">
<div class="item-content" style="background:url(ImageResize.aspx?imgsrc=images/test.jpg&width=127) no-repeat;"></div>
<div class="item-type video"></div>
</div>
<div class="item-caption">Test</div>
</div>
我相信问题是在C#中,ASP.NET头文件
Response.Buffer = true;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "image/jpg";
Random random = new Random();
int randomNumber = random.Next(1000000);
//Response.AddHeader("content-disposition", "attachment;filename=" + $randomNumber.ToString() + ".jpg");
/*resize happens here*/
bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.Flush();
Response.End();
bmp.Dispose();
image.Dispose();
有什么想法吗?
所有我想是调整图像大小并且将其输出为jpg
您的链接位于localhost,我们无法访问该页面。如果您希望我们看到该页面,请使用公共链接。 – Abel
您似乎暗示当您单击该链接时,图像会显示在_all_浏览器中,但不会在您运行JavaScript时显示。由于JS可能非常依赖于浏览器,所以您最好向我们展示JavaScript代码**,而不是与浏览器无关的服务器端代码。你所展示的是一种CSS风格,而不是JS。 – Abel