I use <input type="file" id="fileId" name="fileId"/> and
<% = Html.TextBoxFor (x => x.FileName, new {@ class = "className", maxlength = 255, id = "fileName"})%> in my mvc project. I want to save in a text box the file name selected in the INPUT element. How can I do this?
I use <input type=file id=fileId name=fileId/> and <% = Html.TextBoxFor (x => x.FileName, new
Share
You need to use javascript to achieve this. Here’s an example with jquery: