473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

inheritance in converstion from ASP.NET 1.1 to 2.0

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

Nov 19 '05 #1
3 1161
These are courtesy of Karl Seguin, who often posts here:

http://west-wind.com/weblog/posts/3016.aspx
http://forums.asp.net/785610/ShowPost.aspx

I haven't tried converting a project, but on the project I'm working
on the code_behind files are not going into App_code automatically --
maybe there's some option -- and to me, with limited experience, that
would be where they belong.

Andre Ranieri wrote:
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


Nov 19 '05 #2
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 6 Oct 2005 11:02:03 -0700, "Andre Ranieri"
<An**********@discussions.microsoft.com> wrote:
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


Nov 19 '05 #3
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

"jh*****@yahoo.com" wrote:
These are courtesy of Karl Seguin, who often posts here:

http://west-wind.com/weblog/posts/3016.aspx
http://forums.asp.net/785610/ShowPost.aspx

I haven't tried converting a project, but on the project I'm working
on the code_behind files are not going into App_code automatically --
maybe there's some option -- and to me, with limited experience, that
would be where they belong.

Andre Ranieri wrote:
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


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Ricky Romaya | last post by:
Hi, Are there any ways to get multiple inheritace in PHP4? For example, I have 3 parent class, class A, B, and C. I want class X to inherit all those 3 classes. Consider merging those 3 classes...
0
by: John Hunter | last post by:
I am using pycxx 5.2.2 to implement some extension code and have a problem relating to inheritance. I have a pure virtual base class and two concrete derived classes. In the code below, everthing...
2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
2
by: Graham Banks | last post by:
Does using multiple inheritance introduce any more performance overhead than single inheritance?
4
by: JKop | last post by:
I'm starting to think that whenever you derive one class from another, that you should use virtual inheritance *all* the time, unless you have an explicit reason not to. I'm even thinking that...
5
by: Morgan Cheng | last post by:
It seems no pattern defined by GoF takes advantage of multiple inheritance. I am wondering if there is a situation where multiple inheritance is a necessary solution. When coding in C++, should...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
6
by: Bart Simpson | last post by:
I remember reading on parashift recently, that "Composition is for code reuse, inheritance is for flexibility" see (http://www.parashift.com/c++-faq-lite/smalltalk.html#faq-30.4) This confused...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.