asp.net mvc - MVC 4 - Url.Action - How can I pass all information on the form to the action method? -
i have following mvc 4 code renders images page:
@foreach (var photo in @model.imagelist) { <a href="@url.action("deletephoto","listing",new { imageid = photo.imageid })"> <img src="@url.action("getphoto", new { id = photo.imageid })" alt="" title="click on image remove it" width="250" height="190"/> </a> }
when user clicks on image, deletephoto method called on listing controller. i'd pass method model, values, view bound to. there way can this? i'm still new mvc i'm not sure best way this.
note: view bound model contains quite bit more information images. view data entry form, ability include pictures. so, when image deleted, want refresh form, , keep whatever information user has entered can redisplay it. and, it's quite possible information hasn't been saved db yet.
i can recommend read similar question: is possible pass object route value in mvc 3?
in few words-no,you can't in way.
Comments
Post a Comment