I have followed the blog post written by Steve Sanderson at blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc. It all work fine when follow it exactly but I was hoping that someone may have looked at it and be able to assist me in adapting it slightly.
I basically have this "partial request" calling from one controller to another and this works fine. I then want to foreach through the data and create a drop down list. The problem is that I need to convert it to an IEnumerable to do this but it fails telling me that I cannot convert a void to an IEnumerable.
The lkine fails on is in the view and is:
foreach (var category in (IEnumerable<MyObject>) ((PartialRequest)ViewData["ReturnedData"]).Invoke(ViewContext))
Clearly, knowing how to answer this is hard without seeing the code. This is all in the aforementioned post but as it is reasonably lengthy I do not want to post it all in here. I understand that this makes answering this difficult and am hoping that someone has ready that post and can assist.
Thanks in advance.