ClientFormat/ ClientFunction for System.Convert.ToBase64String()
I'd like to use some conversion of razor @System.Convert.ToBase64String(@Model.TempPhoto) to display an image (jpg) in a grid. My guess is using ClientFormat or ClientFunction could be a direct way of accomplishing that, but I don't see an example ... what is the best way of getting a byte[] from ".(TempPhoto)" of the Json response to @System.Convert.ToBase64String() ?
Stephan Luis
asked
at 27 Jul 2018
Answers
-
ClientFormat
andClientFormatFunc
are different ways of generating html inside the grid cell, what value you put in there it is up to you: https://www.aspnetawesome.com/learn/mvc/Grid#Custom-Formatting think you should be generating this Base64 string inside theMap
in the controller: https://www.aspnetawesome.com/learn/mvc/Grid#Map and after you can just define the format inClientFormat
Omuanswered at 27 Jul 2018