Dheeman Dutta
Just Another Blog.....
search for term
Home
Contact
Syndication
Login
News
Post Categories
SqlServer
Archives
January, 2010 (2)
May, 2009 (1)
January, 2009 (1)
December, 2008 (1)
July, 2008 (1)
January, 2008 (2)
June, 2007 (1)
May, 2007 (1)
April, 2007 (3)
February, 2007 (1)
January, 2007 (2)
December, 2006 (1)
November, 2006 (3)
October, 2006 (1)
September, 2006 (4)
August, 2006 (1)
July, 2006 (7)
June, 2006 (7)
.NET Links
.NET and Sqlserver
All ASP.NET 2.0 Controls
http://blogs.msdn.com/wriju/
http://weblogs.asp.net/scottgu/
http://weblogs.asp.net/scottgu/archive/2008/01/04/jan-4th-links-asp-net-asp-net-ajax-asp-net-mvc-visual-studio-iis7.aspx
My Own link
Recommended Reading
Wizard Control
<< Debugging during Remoting when general debug statements are not hit
|
Home
|
SQlServer 2005 varchar/nvarchar datatype size >>
PageBaseType
pageBaseType is an extremely powerful setting that you might to use when all your application pages inherit from a common class. it is in the
section of the web.config.
Share This Post:
Print
| posted on Sunday, July 23, 2006 11:08 AM
Feedback
#
re: PageBaseType
left by
Ravi
at 6/11/2007 11:20 PM
Hi,
Can you share a real life example.
Thanks
Ravi
#
re: PageBaseType
left by
Dheeman Dutta
at 6/12/2007 6:04 PM
Suppose you are trying to load a Masterpage explicitly using code based on some conditions , and this applies to all the pasge in your website. Using this contaring for loading master pages , you won't be able to specify the master page while adding any page in the website.
Suppose we have this class
>>>>>
public class DynamicMasterPage : System.Web.UI.Page
{
protected override void OnPreInit(EventArgs e)
{
// LoadMasterPage() loads a master page based on some criteria.
string masterFile = LoadMasterPage();
if (!masterFile.Equals(string.Empty))
{
base.MasterPageFile = masterFile;
}
base.OnPreInit(e);
}
}
>>>>>>
Now in order to make all pages in your website inherit from this class you need to mention the pageBaseType in the Web.Config.
>>>>
<system.web>
<pages pageBaseType="DynamicMasterPage" />
</system.web>
>>>>>
Cheers
#
re: PageBaseType
left by
Vladimir Kelman
at 4/21/2008 6:57 AM
Only works with inline ASPX pages, unfortunately. VS still generates code-behind pages inheriting System.Web.UI.Page, which overrides pageBaseType. So, it is pretty useless.
http://pro-thoughts.blogspot.com/
#
re: PageBaseType
left by
shingo yabuki
at 12/30/2010 7:51 PM
it's not useless actually, using .net 3.5 and above I made a common basepage and every page had to override a method I created, even though the page behind will inherit from system.web.ui.page on visual studio, the compiler will complain about the lack of implementation of the abstract methods forcing that page to change it's inheritance to the type defined on web.config
#
re: PageBaseType
left by
Sagar
at 6/17/2011 4:39 PM
inherits attribute from @Page directive overrides the pageBaseType value of web.config.
but I don't want to override it.How would I stop from overriding?
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
Enter the code shown above
Remember Me?