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 Image is

HTML

   

Administrator action

  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

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -