0

the problem I have is the data doesn't show in the input box

<div class="form-group">
            <label asp-for="MovieImage" class="control-label"></label>
            <input asp-for="MovieImage" class="form-control" type="file" />
            <span asp-validation-for="MovieImage" class="text-danger"></span>
</div>
10
  • but when i convert the data the image is shown , what i want is to show the name of the data in the input box; HOW ?? Commented May 8, 2022 at 21:21
  • You can't. The only way to set the value of a file input is by the user to select a file. This is done for security reasons. Commented May 9, 2022 at 4:12
  • I know that but what i want is when the user want to edit the the movie image so he can see the previous one and if he want to edit it he will, did u get my point ? i see many people doing this but i don't know how. PLEASE some help @Rena Commented May 9, 2022 at 17:59
  • I think what you want is to store the file path to the property, and use <img src="/@Property"/> to display the image. Reference: stackoverflow.com/a/68478536/11398810 Commented May 10, 2022 at 1:40
  • thank you, but not that what i want, the image is being displayed and the image is transferred from the controller to the edit view and i can display it alone as a static object in the page the user can't edit it, but my problem is the image is not being displayed in the input file field so the user can see it there and edit it, i don't know how to do it ?? Commented May 10, 2022 at 2:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.