user1614777
user1614777

Reputation: 11

asp.net mvc jquery dialog one-to-many data updates

Here is the scenario. I have a view for creating orders. The view has some header information to be captured like address of customer, delivery mode etc., There is also a grid to show the list of products that the customer has ordered. When customer wants to add a product, I show the jquery dialog modal which will have the product information. When I click save on the dialog, I run into few questions.

  1. How do I pass the data back to main view and link the product List<Product> data and save it within the Order class?

  2. Are there any better way of doing it? I need the dialog modal instead of going back and forth to different pages.

Upvotes: 0

Views: 234

Answers (1)

Eric J.
Eric J.

Reputation: 150228

It depends on the specific requirements.

I do something very similar to what you describe. My modal dialog makes an Ajax post back to a controller to update the entity it is editing and closes itself.

I then trigger another portion of the HTML to refresh via an Ajax call once the modal dialog closes (for example, if you are showing a list of things being edited).

Upvotes: 1

Related Questions