Search code examples
asp.netmaster-pagesvirtualpathprovidercontent-pages

VirtualPathProvider problem with content pages


I have a VirtualPathProvider that works fine with asp.net pages. It compiles in runtime and run everything well. But, when I try to open a page that contains asp:Content tags, I always getting:

Only Content controls are allowed directly in a content page that contais Content controls.

In other words, when I use content pages, VPP not work. I tested with physical master page and with a VPP provided master page and in all tests, the result are the same.

Anybody have this same issue? What I can do to VPP start to work with content pages?


Solution

  • Working on other things, I finally found the answer. My files are stored on a database, and I'm dropping the last byte of file on save procedure.

    This errors doesn't cause problems on major types of files, but, I have a problem with a DOCX upload and, when I find the cause, the ASPX content pages problem with VPP is gone.