Spice
Spice copied to clipboard
Coupons without image uploaded
@bhrugen In the current version if the Coupon is uploaded without an image file selected, then Details and Edit Views cannot load properly due to the Model.Picture being null.
Just a small change and the view can be rendered without any image if the Picture property is null. I can submit a Pull Request with the proposed change.
@bhrugen @PRS-M
hi
I had the same Problem , in the Coupon <Delete View> or other views i used this code and Problem is solved :
@{
if (Model.Picture==null){
<p>No picture is available</p>
}
else{
var base64 = Convert.ToBase64String(Model.Picture);
var imgsrc = string.Format("data:image/jpg;base64,{0}", base64);
<img src="@imgsrc" height="100%" width="100%" />
}
}