inheritance in converstion from ASP.NET 1.1 to 2.0

G

Guest

I downloaded VS 2005 web express beta 2 the other day for the purposes of
learning more about it and seeing what is involved with converting my ASP.NET
code base from 1.1 to 2.0. I've read a few articles on 2.0 but in practice
it's behaving differently that I expected.

I converted a backup copy of our corporate website to 2.0 and am seeing a
problem with inheritance. When I developed it in 1.1 I created a base class
"public class BasePage : System.Web.UI.Page " and all my code-behind files
inherit from this class. The class contains my SqlConnection and SqlCommand
objects and some functions that are used throughout the site.

In 2.0 the code behind and other stand-alone class files were moved to the
APP_Code directory as I expected. However, every page in the site now shows
the warning, this is not expected and I'm a bit stumped on what to do.

"Warning 1 Warning : Please make sure class 'BasePage' is defined in code
folder or in a referenced assembly. About1960.aspx.cs (Line
20) About1960.aspx.cs"

Since this is my first foray into .NET 2.0 I'm a bit out of my element with
what I'm seeing. Would somebody please point me in the right direction, or
at least pass on some relevant reference materials?

Thanks in advance for your help.

Andre Ranieri
 
S

Scott Allen

It sounds like your base class is perfectly fine. As line as the stand
alone file made it into App_Code the class will be compiled, and the
assembly coming out of App_Code is automatically referenced by any and
all web assemblies for your pages.
 
G

Guest

Thanks. I moved my BasePage.cs file out of App_Code and into the app's root
directory and things worked fine.

I appreciate the good article, too!

Andre
 

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