[CLOSED] Problem rendering partial view

  1. #1

    [CLOSED] Problem rendering partial view

    Hi,

    I have the code below to render a ext partial view in my MVC3 application using Razor view engine

    @Html.RenderExtPartial("north.csthml");
    But I got an exception saying "Object reference not set to an instance of an object." and here is the line where the exception occurs in PartialViewRender.cs:

    string path = ((WebFormView)view).ViewPath;
    looks like the viewengine was casted to WebFormView even if I am using Razor. Could someone please look into this? Thanks.
    Last edited by Daniil; May 02, 2012 at 9:43 PM. Reason: [CLOSED]
  2. #2
    Yes, at this moment it is not updated yet
    I suggest to use panel or container and load into it
    @(
            Html.X()
            .Container()
            .ContentFromPage(this, "PartialRazorView.cshtml")              
        )
  3. #3
    Is there any update on when this might be fixed?

    I have a scenario where I have a page with several partial views each of which needs it's own model to render and I can't see a way that I can pass the relevant model into each partial without the RenderExtPartial method working?
  4. #4
    It's under processing.

    For now we can suggest to pass a required data via the third parameter.
    .ContentFromPage(this, "~/Views/Razor/SubPage.cshtml", param1, param2)
    You can access this data within a partial view using the PageData property.
  5. #5
    Hi,

    Under Razor engine please use standard 'Html.RenderPartial'

Similar Threads

  1. ASP.NET MVC partial rendering
    By wdk in forum 1.x Help
    Replies: 16
    Last Post: Jul 20, 2012, 12:01 PM
  2. [CLOSED] Partial View Error
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 10, 2012, 10:32 AM
  3. [CLOSED] rendering desktop windows using partial view
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jan 11, 2012, 6:42 PM
  4. [CLOSED] RegisterOnReadyScript in MVC partial view
    By SandorD in forum 1.x Legacy Premium Help
    Replies: 22
    Last Post: Aug 10, 2011, 4:17 PM
  5. [CLOSED] Dynamically Added Tab not rendering partial view
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 13
    Last Post: Apr 26, 2011, 9:10 PM

Tags for this Thread

Posting Permissions