pageBaseType attribute in pages element

M

Martin Kulov [MVP]

Hi,

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

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
 
J

Jialiang Ge [MSFT]

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 ([email protected], 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:
(e-mail address removed).

==================================================
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.
 
M

Martin Kulov [MVP]

Jialiang Ge said:
Hello Martin,

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


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
 
J

Jialiang Ge [MSFT]

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 ([email protected], 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:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
J

Jialiang Ge [MSFT]

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 ([email protected], 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:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
M

Martin Kulov [MVP]

Jialiang Ge said:
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.


Thanks a lot, Jialiang!

Martin Kulov
www.kulov.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top