ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
ClientFormat/ ClientFunction for System.Convert.ToBase64String()
Title:
B
I
{code}
?
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() ?
Save Changes
Cancel
Stephan Luis
asked at 27 Jul 2018
Answers
B
I
{code}
?
`ClientFormat` and `ClientFormatFunc` 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 the `Map` in the controller: https://www.aspnetawesome.com/learn/mvc/Grid#Map and after you can just define the format in `ClientFormat`
Save Changes
Cancel
Omu
answered at 27 Jul 2018
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK