Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting the default base class for pages in a site 1

Status
Not open for further replies.

mgriffith

MIS
Jul 3, 2001
177
0
0
US
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=&quot;[true|false]&quot; // Default: true
enableSessionState=&quot;[true|false|ReadOnly]&quot; // Default: true
enableViewState=&quot;[true|false]&quot; // Default: true
enableViewStateMac=&quot;[true|false]&quot; // Default: false
smartNavigation=&quot;[true|false]&quot; // Default: false
autoEventWireup=&quot;[true|false]&quot; // Default: true
pageBaseType=&quot;[typename]&quot; // Default: System.Web.UI.Page
userControlBaseType=&quot;[typename]&quot; // Default: System.Web.UI.UserControl
-->
<pages pageBaseType=&quot;YourAssembly.DerivedPage,YourAssembly&quot; />


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top