on this question ModelBinding asp.net MVC List I was answered how to bind on a create action. But How I bind the same Movie class with it tags propertie on an edit action?
Because when I do this:
public ActionResult Edit(string movieid)
{
if(!string.IsNullOrEmpty(movieid))
{
ViewBag.Edit = true;
var movie= db.GetCollection().FindOne(new { Name = movieid});
if(movieid== null)
throw new HttpException(404, "Movie not found");
return View(movie);
}
return RedirectToAction("Index","Home");
}
On the View at the input text I get: System.Collections.Generic.List`1[System.String]
How I bind the list to an Input text, on the render of the view?
Thanks!
you can render your list of tags (string) in one textbox using
and if you have implemented custom model binder as Darin suggested in his answer you referred to, it will bind again to Tags lit on server side
Try returning
I believe you are returning a list of one movie instead of what the actual string value of the movie is.