Feb 15, 2011, 8:04 PM
[CLOSED] Null view model with PartialViewRenderer
Hi,
I'm having trouble passing a view model when calling RenderExtPartial, for example:
Please see line 55 :
Could you please advise if this is a bug?
I'm having trouble passing a view model when calling RenderExtPartial, for example:
<%= Html.RenderExtPartial("FeedPortlet", new RssReader { Title = "The Publican News Feed", Url = "http://www.thepublican.com/rss.asp?navcode=196" }, IDMode.Explicit)%>
When the code executes in the partial view the model is null. When stepping through the source code of Ext.Net.MVC\Results\PartialViewRenderer.cs I notice that the view model is lost when the ViewDataDictionary is created. Please see line 55 :
newViewData = new ViewDataDictionary(viewData) { Model = model };
And then line 63: ViewContext viewContext = new ViewContext(context, view, viewData, new TempDataDictionary(), context.HttpContext.Response.Output);
See how the original object is used as the parameter, not "newViewData".Could you please advise if this is a bug?
Last edited by Daniil; Feb 17, 2011 at 8:28 AM.
Reason: [CLOSED]