I have an image in my view, as:
<img width="150" height="150" scr="@Url.Action("GetImage", "Item")" />
My controller, ItemController, has this method:
public FileContentResult GetImage(){
var model = _itemService.GetItemImage(1);
if(model != null && model.ImageData != null){
return File(model.ImageData, model.ImageMimeType);
}
return null;
}
When the view renders, I get the following markup for my image but no image is rendered:
<img width="150" height="150" scr="/MyApp/ItemManagement/Ge开发者_Go百科tImage"/>
If I type this url 'http://localhost/MyApp/ItemManagement/GetImage' in the browser, I get the image. I'm not sure what's wrong with this. Could someone point out what is wrong with my code please?
Thanks in advance. Jeff
Image attribute should be src
...?
精彩评论