views:

11

answers:

0

In a custom editor template I want to access the parent object.

I'm using this code but this is probably not the best way to do it, especially when using nested views:

object parent = ViewContext.Controller.ViewData.Model;

Does anybody have a better idea?