I am trying to pass an image stored in a viewmodel from my controller to my razor view. The two [barcode] images (System.Drawing.Image
) are defined as below:
ShippingSummaryViewModel shippingSummaryVm = ShippingSummaryViewModel.ToShippingSummaryFromOrder(orders);
shippingSummaryVm.CustIdBarcode = CreateBarcode(shippingSummaryVm.customer_code);
shippingSummaryVm.SalesOrderBarcode = CreateBarcode(shippingSummaryVm.order_id);
in my view, I would like to be able to use an <img>
tag to reference these images but I am not sure what to put for the source as setting the src equal to @Model.CustIdBarcode
does not work due to getting a 404 resource not found error. All help is appreciated
Edit: In my razor view, I am using <img src="@Model.SalesOrderBarcode"/>
and <img src="@Model.CustIdBarcode" />
to try and display the images. These fields in my viewmodel look like:
public Image SalesOrderBarcode { get; set; }
public Image CustIdBarcode { get; set; }
and the errors I get when rendering the page are:
GET http://localhost:63957/Orders/System.Drawing.Bitmap 404 (Not Found)