I am trying to send Image and ImageName from View to Controller.
Here\'s how my controller looks:
[HttpPost]
public ActionResult Add(BoxAddViewMo
Your using the wrong overload of BeginForm()
and adding route values, not html attributes (always inspect the html your generating). Use
@using (Html.BeginForm("Add", "BoxManagement", FormMethod.Post, new { @class = "form-horizontal", enctype = "multipart/form-data" }))
Side note: Remove new { @name = "Name"}
from your TextBoxFor()
method. Never attempt to override the name
attribute generated by the HtmlHelper
methods unless you want binding to fail (and is this case it does nothing anyway)