hi guys how to i able to insert imageurl into database? after i insert into my database , my imageurl row appears to be NULL.
public HttpPostedFileBase ImageURL { get; set; }
my question.cshtml
<tr>
<td colspan="3">
@Html.LabelFor(model => model.ImageURL)
@Html.TextBoxFor(model => model.ImageURL, new { type = "file", id="fileupload", name="fileupload" })
@Html.ValidationMessageFor(model => model.ImageURL)
<img src="#" id="imgThumbnail" alt="preview" width="10%" height="15%" />
</td>
my controller
foreach (QuestionVM0 q1 in qo)
{
int aID = question1.ActivityID.Value;
string sImageURL = q1.ImageURL.ToString();
Models.question1 questionCreate = new question1();
questionCreate.ImageURL = sImageURL;
db.questions1.Add(questionCreate);
db.SaveChanges();
}