Web Page code behind inherits from another class

M

Mark

In ASP.NET 1.x a codebehind file X could inherit from class Y assuming that
Y inherited from System.Web.UI.Page. In ASP.NET 2.0 this appears to be
problematic since the previous codebehind is now a partial class and is more
closely tied to the .aspx page. Is it possible to mimic this behavior in
ASP.NET 2.0?

The pros/cons of this approach could be argued but we have a number of
existing applications using this technique that we need to migrate.

Thanks in advance.

Mark
 
B

Brock Allen

In ASP.NET 1.x a codebehind file X could inherit from class Y assuming
that Y inherited from System.Web.UI.Page. In ASP.NET 2.0 this appears
to be problematic since the previous codebehind is now a partial class
and is more closely tied to the .aspx page.

They were just as tightly coupled in 1.x.
Is it possible to mimic this behavior in ASP.NET 2.0?

The inheritance model in 2.0 is no different than it was in 1.x. What's different
is who compiles the codebehind. In 1.x VS.NET compiled the codebehind whereas
in 2.0 ASP.NET compiles the codebehind.
The pros/cons of this approach could be argued but we have a number of
existing applications using this technique that we need to migrate.

For migration purposes there's a VS.NET 2005 addin called "Web Application
Projects" designed to help in migration of older VS.NET 2003 projects to
compile and run under ASP.NET 2.0. It's up on MSDN somewhere -- I'd suggest
googling for it.
 
W

Walter Wang [MSFT]

Hi Mark,

Thank you for posting!

I agree with Brock on this. You can find Web Application Projects here:
http://webproject.scottgu.com/



Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top