c# - Using a .NET MVC Controller Action as the Source for an HTML <img> -
I am trying to display an image associated with a user in my database (image field's data type HTML Administrator action Image is
public byte [] image (id) {UserRepository r = New UserRepository () ; Return R. Single (ID) .logo.ToArray ();}
< Strong> Problem solved
< P> Sorry, I did not read enough on this! All that was needed to do is make the Controller Action Return FileContentResult
Public FileContentResult Image (User ID) {UserRepository r = New UserRepository (); New File Content Result (R. Single). Return ToArray (), "Image / JPEG");}
Comments
Post a Comment