0
我試圖使用Dojo對話框來顯示圖像,但我的代碼背後或在我的前端有問題。我認爲這是Content-type的問題。Dojo對話框顯示圖像
public ActionResult GetUploadedFile(int FileUploadId)
{
var photos = new GenericRepository<FileUpload>().Find(x => x.FileUploadId == FileUploadId);
if (photos.Any())
{
var photo = photos.First();
Response.AppendHeader("Content-Type", "image/jpeg");
return File(new WebImage(photo.Path).GetBytes(), "image/jpeg");
}
// Loading a default photo for realties that don't have a Photo
return File(new WebImage(HostingEnvironment.MapPath(@"~/Content/images/no-photo100x100.png")).GetBytes(), "image/png");
}
任何人都可以幫助我嗎?
你可以在這裏發佈JS dojo對話框代碼嗎?還請附上由ASP.net生成的HTML結果代碼(帶有dojo dialog JS)。 –
感謝您的評論,但很難得到代碼,因爲這個CMS隱藏了很多東西。但我解決了在dojo上使用append方法。 – AFetter