This question is locked. New answers and comments are not allowed.
In the first look example (http://demos.telerik.com/aspnet-mvc/razor/upload) for the UPLOAD control there's code that looks like this for the view:
And this for the controller:
The Upload works.
The mainImage parameter for the Remove ActionResult is always NULL so it's not working.
Where is this parameter set?
Thanks
<div> <label for="LightboxImage">Lightbox Image</label> @(Html.Telerik().Upload() .Name("mainImage") .Multiple(false) .Async(async => async .Save("Upload", "Flyers") .Remove("Remove", "Flyers") .AutoUpload(true) ))
</div>And this for the controller:
public ActionResult Upload(HttpPostedFileBase mainImage){ var fileName = Path.GetFileName(mainImage.FileName); var physicalPath = Path.Combine(Server.MapPath("~/Flyers"), fileName); mainImage.SaveAs(physicalPath); return Content("");}public ActionResult Remove(string mainImage){ var fileName = Path.GetFileName(mainImage); var physicalPath = Path.Combine(Server.MapPath("~/Flyers"), fileName); if(System.IO.File.Exists(physicalPath)) System.IO.File.Delete(physicalPath); return Content(""); }The Upload works.
The mainImage parameter for the Remove ActionResult is always NULL so it's not working.
Where is this parameter set?
Thanks