tags:

views:

11

answers:

1

I call Create() which puts an object in session and returns a view. On that view is a button to "Add Item", which redirects to another controller, they select and item, and that id is returned to the first controller. But I can't return to the same Create() method since that puts a new object in session, overwriting any changes they may have entered before clicking "Add Item". How should I return to Create() when there may be some data already entered?

thank you.

A: 

In the body of your Create() method you could check if there already is an item in session. If that is true then you can continue modifying that item. Otherwise this is a first request and only then should you put a new item in session.

marcind