0

I'm trying to render an .ascx file to a string using this method

How to Render Partial View into a String

And it works fine. But if the .ascx file that I'm trying to render contains another .ascx file rendered like so

<%= Html.Partial("Picture/ProfilePicture", pictureThumb)%>

I get the exception

View cannot be null

when rendering ProfilePicture.ascx

Community
  • 1
  • 1
Mihai
  • 2,740
  • 31
  • 45
  • is picturethumb null by any chance? – Liam Feb 15 '13 at 09:12
  • no :), the IView parameter of the method that actually renders the .ascx file is null. This only fails when I try to render the parent .ascx file as string, otherwise it works fine – Mihai Feb 15 '13 at 09:16

0 Answers0