I am working at a project and i want to save the path of the image saved in Content/assets folder in database .curenttly i am saving the path by passing it in a textbox and then transmit to my create method.How can i make a photo picker and save the path to my textbox?
Here is my view:
@using (Html.BeginForm("Create", "Rooms", FormMethod.Get, new { @encType = "multipart/form-data" }))
{
<div class="editor-label">
@Html.Label("RoomNumber")
@Html.TextBox("RoomNumber")
</div>
<div class="editor-label">
@Html.Label("RoomType")
@Html.DropDownList("RoomType_id", new SelectList(Model.tip.AsEnumerable(), "RoomType_ID", "Room_Type"))
</div>
@Html.Label("Floor")
@Html.DropDownList("Floor_id", new SelectList(Model.etaj.AsEnumerable(), "Floor_ID", "Denumire"))
<div class="editor-label">
@Html.Label("NumberOfSpots")
@Html.TextBox("NumberOfSpots")
</div>
<div class="editor-label">
@Html.Label("Status")
@Html.TextBox("Status")
</div>
<div class="editor-label">
@Html.Label("Status")
@Html.TextBox("Status")
</div>
<div class="editor-label">
@Html.Label("AlbumArtUrl")
@Html.TextBox("AlbumArtUrl")
</div>
What about
input type="file"?Then you can hook into the change event in jQuery if needs be, like so: