user1287453
user1287453

Reputation: 279

Create/Edit Parent and Child Form MVC

I am using C# and MVC3

I have a simple Entity Model

Entities: Orders , OrderItems

Orders have 0 or more Order Items

I want to create a single page to create an order

While on this Page I would fill in the fields that are in the Orders table (Customer, Phone, Order Number...etc)

Then there would be a grid (I am using Telerik MVC grid). I want to add OrderItems to this grid. I was thinking of having s small form above the grid with its own submit button. I can submit using ajax and refresh the grid using ajax.

At the bottom there would be a single submit button that coudl create the order and all the orderitems at once.

I can't seem to piece this enitre solution together.

Upvotes: 4

Views: 4897

Answers (1)

Yusubov
Yusubov

Reputation: 5843

Short answer: follow this post - how to implement Create action on Order and Order Details on single Create View

Basically, convert your code to partial views in your main view. Also separate order entry form from displaying the order list. Also you may find useful to look at this resource - Empty Model with Partial View

Upvotes: 1

Related Questions