Hello,
I already have stored image into database using below code
user.UserImage = new Byte[image1.ContentLength];
image1.InputStream.Read(user.UserImage, 0, image1.ContentLength);
Now I want to Store this into session and Retrieve on Dashboard Page.
But image is not showing. pls help.
What I have tried:
In Controller:
string imageDataURL = string.Format("data:image/png;base64,{0}", dataitem.UserImage);
Session["UserImage"] = imageDataURL;
In View:
var img = (Session["UserImage"]);
string imageSrc = string.Format("data:image/gif;base64,{0}", img);
<img src="@imageSrc" width = "60" height = "60" class="img-profile rounded-circle"/>