i am having trouble uploading an image from the website to the server.
My ajax form is taking everything except the image file. I saw a similar question here ASP.Net MVC 5 image upload to folder
but i can't seem to get it to work
i have this
public HttpPostFileBase imageFile {get;set;}
public string imageText {get;set;}
public string imageTitle {get;set;}
public bool isActive {get;set;}
public DateTime dateAdded {get;set;}
public string urlRedirect {get;set;}
public ActionView Index()
{
return View;
}
public void UploadImage (CarouselController carouselImage)
{
// some code
}
my ajax begin form takes in all the fields with html razor.
@Html.TextBoxFor(model =>model.imageText , new {class = "form-control"} )
... similar for the other fields.
for the image i have
@html.TextBoxFor(model => model.imageFile), new { type="file"})
this makes it a working selection input box but it doesn't pass any information to the upload method.
see attached picture for what i mean.