0

I need to upload a CSV file to my MVC application where in a view I need to map columns and in next view I need to show some data imported from the csv file to user and if user is satisfied with that data display, he can move further otherwise he can go back and do the changes accordingly in columns mapping.

My concern is to to show columns mappings which were selected by him. Please suggest best way to do that and it should be safe in concurrent request as multiple users will be doing this task.

Thanks, Jshunjan

JSHunjan
  • 397
  • 1
  • 5
  • 18

1 Answers1

1

Keep the user columns mapping selection in the hidden field in the form, then post it accordingly to the relevant controller. So, in short:

  1. Let the user choose the columns available.
  2. Upon going to another page, post the user selections too.
  3. If you need that selection again for the other form, maintain user selection by putting it in the hidden field of relevant page and post it accordingly to the relevant controller.

Alternatively, can use TempData feature. Please refer to the link below for explanation:

Using Tempdata in ASP.NET MVC - Best practice

Hope it helps.

Community
  • 1
  • 1
Hatjhie
  • 1,366
  • 2
  • 13
  • 27