-
1
- #1
if you have created some sort of derived page (from System.Web.UI.Page) for templates or other reasons, and you wish to use this as the default page base class (rather than System.Web.UI.Page), then simply add this line into your web.config file
<!-- pages Attributes:
buffer="[true|false]" // Default: true
enableSessionState="[true|false|ReadOnly]" // Default: true
enableViewState="[true|false]" // Default: true
enableViewStateMac="[true|false]" // Default: false
smartNavigation="[true|false]" // Default: false
autoEventWireup="[true|false]" // Default: true
pageBaseType="[typename]" // Default: System.Web.UI.Page
userControlBaseType="[typename]" // Default: System.Web.UI.UserControl
-->
<pages pageBaseType="YourAssembly.DerivedPage,YourAssembly" />
you can also set other default page options in here, as noted. i got this information from the machine.config file after googling got me nowhere. hopefully this will safe someone some time in the future.
the reason i needed it was because i've created a page template that uses a user control as a wrapper for content. i've mapped html, htm, aspx, etc to the system.web.pagehandlerfactory and now i wanted to remove all unnecessary lines from the pages. i've finally got it so that if a user creates any page in frontpage or whatever and sticks it in a subfolder in my website, it will get my template no questions asked. i think it's pretty neato. mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
<!-- pages Attributes:
buffer="[true|false]" // Default: true
enableSessionState="[true|false|ReadOnly]" // Default: true
enableViewState="[true|false]" // Default: true
enableViewStateMac="[true|false]" // Default: false
smartNavigation="[true|false]" // Default: false
autoEventWireup="[true|false]" // Default: true
pageBaseType="[typename]" // Default: System.Web.UI.Page
userControlBaseType="[typename]" // Default: System.Web.UI.UserControl
-->
<pages pageBaseType="YourAssembly.DerivedPage,YourAssembly" />
you can also set other default page options in here, as noted. i got this information from the machine.config file after googling got me nowhere. hopefully this will safe someone some time in the future.
the reason i needed it was because i've created a page template that uses a user control as a wrapper for content. i've mapped html, htm, aspx, etc to the system.web.pagehandlerfactory and now i wanted to remove all unnecessary lines from the pages. i've finally got it so that if a user creates any page in frontpage or whatever and sticks it in a subfolder in my website, it will get my template no questions asked. i think it's pretty neato. mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu