D
D
Devil Devil2016-07-14 11:41:43
ASP.NET
Devil Devil, 2016-07-14 11:41:43

Image from database to view?

There is a form for editing data, for example, the
name of the picture
and the image itself (stored in the database as varbinary)
how to correctly display it in the view so that when changing only the name and saving, the picture does not disappear?
update method:
e0c90c3b2cce407a8030a431599a2256.JPG
view:
002a5f59354a4a0fb62271904c1d91b2.JPG

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Nemiro, 2016-08-06
@BarkovA

When submitting the form, if the user did not submit another picture, you will have to get the previous picture from the database again and use it when saving.
In principle, if you have flags of a small size, they can be integrated into the view as base64 in a hidden ( hidden ) field :-) Then you don't have to make a request to the database. But in real conditions, this is of little use, since there is a risk of falsifying form data or losing the relevance of the data, which must be checked by getting editable data from the database before making changes to it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question