Building a large complex viewmodel dynamically

Go To StackoverFlow.com

0

I am collecting some data from a user. The data is complex, consisting of up to 40 (as few as 18) fields of data. The path of data entry is also complex and will have multiple sub-paths. I am accomplishing this using partial views, Ajax, and view models. The page never refreshes. This process involves a lot of dynamic content being placed on the page, and a series of evolving view models which contain more and more data as the path is followed. I am going to end up with around 20 partial views and 20 view models.

Is there a more standardized way of doing this while still avoiding a page refresh (such as not using so many view models)?

2012-04-03 21:29
by Travis J
Are you using master pages - Robert Harvey 2012-04-03 21:31
@RobertHarvey - The top view has a master page, the partials use @{ Layout=null }Travis J 2012-04-03 21:32
Aren't master pages server side (read: you need to refresh - huysentruitw 2012-04-03 21:33
@WouterH - The content is dynamically created by a series of AJAX forms which update div ids. The master page sets the stage for the partial views to render as the path is followed. Each partial view is part of a chain updating the parent partial view - Travis J 2012-04-03 21:34
Is knockout something you could use - huysentruitw 2012-04-03 21:35
@WouterH - The issue is the viewmodel, not the dynamic aspect. I want to keep all of the data stored in a viewmodel / multiple view models if necessary - Travis J 2012-04-03 21:35
I guess just go with what works...Making progressively bigger view models, although redundant, does allow for an awesome user experience - Travis J 2012-04-03 22:48


0

No, there is not a standardized way of dynamically doing this.

2012-04-04 22:42
by Travis J
Ads