.NET Framework - pageBaseType attribute in pages element

Asked By Martin Kulov [MVP]
26-Mar-08 10:33 PM
Hi,

I am using the pageBaseType attribute in web.config to define a common base
class for all my pages:

However, when I run the site I do not get an error or any notification that
my pages now inherit from BasePage.

In general I can not see any effect of applying it. Any ideas how can I get
the pageBaseType attribute to work for me.



Thanks,

Martin Kulov

www.kulov.net
ASP.NET
(1)
Ge
(1)
CodeFilebaseClass
(1)
VisualStudio
(1)
PageBaseType
(1)
CodeFile
(1)
Online
(1)
CkID
(1)
  jialg replied...
27-Mar-08 12:55 AM
Hello Martin,

From your post, my understanding on this issue is: you wonder how to define
a common base class with configurations e.g. pageBaseType. If I'm off base,
please feel free to let me know.

In fact, the pagebaseType attribute in web.config ONLY applies to pages
without a codebehind, as per v1.x. For example, if we remove the CodeFile
and Inherits attributes of <%@ Page %>: from the aspx files, and specify
pagebaseType attribute to a self-defined class that inherits from
System.Web.UI.Page, this base page class will be applied to the aspx in run
time successfully.

For more details, please refer to the product feedback "Wrong Code behind
when setting pageBaseType"
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedba
ckID=104608

As this link indicates, we can use a new attribute called codeFilebaseClass
to the page directive in aspx. After the page is created, that will help to
go against some base class that your codeFile also inherits from. However,
the designer will still have generated a codeFile class that extends
System.Web.UI.Page. There is no config entry for codeFilebaseClass. So we
need to manually update codebehind's base class, so that the class defined
in the code file matches the 'inherits' attribute and that it extends the
correct base class (e.g. the class specified in codeFilebaseClass
attribute).

If you have any other concerns or questions, please feel free to let me
know. You are also welcome to add follow-up comments in that feedback link.

Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
  Martin Kulov [MVP] replied...
27-Mar-08 05:14 AM
Thanks Jialiang!
It would be nice to have the pageBaseType setting in web.config to validate
and force usage of this base class for all pages in the web site. At least
that was the idea in the old usage as I remember.
Can you please reconsider?

Thanks,
Martin Kulov
www.kulov.net
  jialg replied...
27-Mar-08 06:32 AM
Hello Martin,

Yes, I agree that it would be very helpful if we can define a custom base
page class for all pages in a config entry of web.config. (The pagebaseType
attribute in web.config ONLY applies to pages without a codebehind). But
unfortunately, I am not in ASP.NET development team. I don't think
Microsoft allows me to decide it :-(    It is my pleasure to help send a
wish to our product designers via internal channel. You are also welcome to
add your supplements to make Microsoft products easier and more powerful to
use by submitting a ticket in https://connect.microsoft.com/VisualStudio.
As we strive to capture any and all product feedback so as to ensure that
we are continuously developing Microsoft products to meet customer needs,
feedback such as yours is always taken very seriously. It is appreciated
that you can paste the suggestion's link here after you submit the ticket
in https://connect.microsoft.com/VisualStudio, so that other community
members can benefit from it.

Regards,
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
  jialg replied...
31-Mar-08 07:22 AM
Hello Martin,

I have sent your wish to the ASP.NET group. Is there anything else I can do
for you? If you need further assistance, feel free to let me know.

Have a great day!

Regards,
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
  Martin Kulov [MVP] replied...
01-Apr-08 12:53 PM
Thanks a lot, Jialiang!

Martin Kulov
www.kulov.net
Create New Account
help
an application which brings back 1000 records from a sql server database. Under the local asp.net development server provided with Visual Studio 2008, it takes about 1.8 seconds When I question is why does it take so long under IIS but not under the local asp.net development server? Any ideas? How can I get this 16 seconds down to a more on both IIS boxes The application is developed using .net framewor 3.5 and c#, asp.net Ilyas ASP.NET Discussions SQL Server (1) Visual Studio 2008 (1) Application Pool (1) App Pool (1) ASP
Confusion versiones ASP.NET y Frameworks .NET Framework Hola. Tengo confusión en sobre los términos que se usan para referirse a las versiones de ASP.NET y los .NET Frameworks: en algunos sitios web se encuentran articulos que hablan de ASP.NET 2.0 trabajando con .NET Framework 3 y 3.5. Y en otros de ASP.NET 2, trabajando con .NET Framework 2.0. Por lo general, esta última referencia es la
ASP.Net - the "Big Picture"? .NET Framework Hi, I have a few questions about ASP.Net, as I have been using it for a while but my knowledge of the "big somewhat vague. . .) - In a closely-related matter, do any languages have issues accessing the full ASP.Net environment and facilities? For example, I found accessing .Net Collections in JScript problematic (though I how to do it). - What support to I have for the "native" Windows features under ASP.Net? Is everything done through the CLR? Can I access ADO COM objects in a moderately
This is a second post on this as the first never showed up in search. ASP.NET Security Discussions ASPNET security (1) Jerry Weng Microsoft Online Community (1) Silverlight (1) NET Framework (1) ASP.NET (1) RIA (1) WCF (1) Application (1) Cancel this. The original showed up. Was a for posting. From your post, my understanding on this issue is: you want to use ASP.NET security in your Silverlight application. If I am off base, please feel free to let me know. If we want to use ASP.NET Authentication in Silverlight applications, we need to create an ASP.NET Application Service. ASP.NET
codefile? By the way, what happened to the App_Code used in 2005? thank you Chris ASP.NET Discussions WebApp.WebForm1 (1) SqlDataSource (1) MyNs.WebForm1 (1) EventArgs (1) ASP.NET (1) ObjectDataSource (1) Subscribe (1) Otherwise (1) If App_Code isn't there its because it use a namespace as well the word 'Product' is fairly common. - - Anthony Jones - MVP ASP / ASP.NET I concur with App_Code, if not in its own assembly. If that is not to you have a line like this, to import the code-behaind class ? Juan T. Llibre, asp.net MVP asp.net faq : http: / / asp.net.do / faq / foros de asp.net, en español