[CLOSED] Null view model with PartialViewRenderer

  1. #1

    [CLOSED] Null view model with PartialViewRenderer


    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]
  2. #2

    Fixed in SVN. Please update
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    Thanks for the update, but still problem exists. I think you need to change line 96 to
    uc.ViewData = newViewData;
  4. #4

    Sorry, forgot about that line. Fixed
    Vladimir Shcheglov
    Sr. Developer
  5. #5
    Thanks. I can confirm it is working now.

Similar Threads

  1. Replies: 1
    Last Post: May 09, 2012, 8:31 AM
  2. [CLOSED] [Razor] Using Model in MVC View
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: May 02, 2012, 4:38 PM
  3. Using model var in mvc view
    By sinai.doron in forum 1.x Help
    Replies: 1
    Last Post: Nov 09, 2011, 5:19 PM
  4. [CLOSED] EXT.NET and ASP.NET MVC View Model
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 18, 2011, 6:04 PM
  5. [CLOSED] [1.0] Ext.Net.MVC PartialViewRenderer.Render
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 08, 2010, 5:12 PM

Posting Permissions