renderview including everything

Nov 16, 2011 at 4:05 AM
Edited Nov 16, 2011 at 4:07 AM


I am using a RenderView extension from your library. Here is how i am calling the method.

this.RenderView("List", Result)

List is cshmtl file that has some list items <li> </li> and the Result is view model.

but the method returns the whole page including the list itmes.

"<!DOCTYPE html><html><head><meta charset=\"utf-8\" /><title></title><link rel.......     </footer></div></body></html>\r\n"

why would it incluse markup that is not on the List.cshtml file?


Nov 16, 2011 at 10:47 AM

try returning this view with return View("List"); and I think you'll get the same

Nov 17, 2011 at 8:15 AM
Edited Nov 18, 2011 at 3:39 AM

Thanks for the tip. 

It was including the content from the _Layout.cshtml.

So, on the List.cshtml I had to add @{ Loayout = "";  } now it does not include the stuff from the _Layout.cshtml.

I am not sure if this is a bug or a feature of MVC...

Thank you!