views:

348

answers:

1

In my app I have a criteria builder section that's built using jquery and is pitched back to the controller in a form post and picked up as IList by the model binder as suggested in Phil's post here: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx

A really simple way that I'm persisting the criteria across posts is re-delivering the IList object to the view. I'm using a DisplayFor() template for this object, but because it's a list I need to know the index # inside of the template.

I'm hoping there's a context value somewhere.

A: 

Well, I couldn't find any information on that kind of meta data, so I had to crud up my view model to contain that index and another property. So now it's a simple Model.IndexItem on the template that returns it's order in the entire collection.

sam