Asp.net MVC multiple uploads with strongly typed view?

As you are going for dynamic upload following thing help you in ASP.net MVC 3.

Up vote 0 down vote favorite share g+ share fb share tw.

I've got a view that is strongly typed to an object, for example let's say a car object. The car object has a name and description. I'd like to be able to have a dynamic number images uploaded, maybe using the Jquery upload plugin, with the the car object, as well as some meta data for the image like date taken.

So how would one use a strongly typed view and a dynamic number of image uploads? I've found a few examples online for this but they use the creation of a new form and therefore the images would go to a different action. Is there a way to have the car model plus the uploaded images data go to the same action?

Is this possible? HttpPost public ActionResult Add(Car car, IEnumerable files) { return View(); } @using (Html.BeginForm()) { Car information @Html. LabelFor(m => m.

Name) @Html. TextBoxFor(m => m. Name) @Html.

ValidationMessageFor(m => m. Name) @Html. LabelFor(m => m.

Description) @Html. TextBoxFor(m => m. Description) @Html.

ValidationMessageFor(m => m. Description) Filename: Filename: } c# jquery asp. Net-mvc asp.

Net-mvc-3 link|improve this question edited Dec 24 '11 at 7:54Floradu887511524 asked Dec 23 '11 at 4:21NullReference33718 88% accept rate.

As you are going for dynamic upload following thing help you in ASP.net MVC 3. Uploadify Jquery AJAX Upload. Now do following thing Create Separate Action that take care of file upload action via Uploadify.

Also make sure you change file to dynamic name. Create one hidden filed that take care of file names that created via Ajax. Now on post of form you have car object and one hidden field for all files for Images and at last you have to map file with card object.

Hope this step help you to create your solution.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions