This project is read-only.

Using N2 to override existing content

Topics: Developer Forum
Oct 21, 2008 at 3:23 PM
I am implementing N2 on a website with existing file-based content. If I create a /page.aspx using N2 and there is a pre-existing physical file called page.aspx, the physical file "wins" when is requested by a web browser.

Can I reverse this behavior? In other words, I would prefer to see the N2 managed content for "page.aspx" rather than the content generated by the physical page.aspx file when I go to

Thanks -

Oct 21, 2008 at 6:01 PM
Not in the released version, but I like the idea. I just committed this configuration option which should work the way you want:

      <web ignoreExistingFiles="true" />

Oct 28, 2008 at 4:35 PM
Thanks libardo!

What is the best way to incorporate this? Do you know when this feature will be "released"?

Nov 1, 2008 at 6:22 PM
You could pick the code from source control and compile yourself.
Nov 4, 2008 at 7:20 PM
Ok, thanks! The checkout is processing as I type this :)

Is there anything I should know about code on the trunk? I was hoping to stick with a release version of N2, so I am a little apprehensive.


Nov 4, 2008 at 9:10 PM
> <web ignoreExistingFiles="true" />

Hi libardo,

I have updated my project with the code from the trunk. This feature seems to work for files but not folders. For example, if I create a page at (no file extension) and I also have a "hello" folder then I see a directory listing for the hello folder instead of the N2 content page. However if then add this successfully overrides the physical world.aspx file.

I browsed the N2 code and the PathIsRewritable function looks correct so I'm not sure why this wouldn't work for directories. Any help you can provide is greatly appreciated.


Nov 5, 2008 at 9:54 PM
Edited Nov 5, 2008 at 9:54 PM
I was looking to do something similar, have you found a way override a directory, so I dont see the directory listing?

Nov 5, 2008 at 10:14 PM
Are you certain this occurs in production? I noticed this in the visual studio dev server but not in IIS.
Nov 6, 2008 at 1:06 PM
> Are you certain this occurs in production?

I just tried in production and the behavior is correct. Thank you very much!