Click to See Complete Forum and Search --> : Inherit a class which is in a separate file ?


Mister.Programmer
February 11th, 2005, 10:09 AM
Hello,


I have the following problem:
I have a class Foo, and a class Bar.


I want Foo to inherit from Bar, but i want to put them in separate
files Foo.vb and Bar.vb. Then i will use the Foo Class in a code behind
separate file called CodeBehind.vb


Then i will use this CodeBehind normally in mypage.aspx.


I don't know the syntax to do this. Do i need to include something
somewhere, or what ? How to link thoses items together without putting
everything in the same file ?
1- How to link foo.vb and bar.vb ?
2- How to link Codebehind.vb and foo.vb ?
I am asking please the concrete syntax to achieve this.


I have converted a huge application from asp to asp.net, and now i need
code behind to be able to compile it. Includes lead me to multiple page
attributes errors, this is why i am asking this.

I am using notepad to program, not visual studio. And i
want to debug and run the software prior to compiling.

Anyone can answer my question please ? If it is impossible to do,
please tell me.

Thanks for your precious help.

Sukim
February 13th, 2005, 06:51 PM
Hi,

The First thing that Links all that you require is linked by the Namespace.

If all are in same namespace the i files doesn't matter.

Make sure all are in same namespace
(if not add that name space in the top of the .vb file with

Imports NameSpaceName // Syntax)

Now let 's inherit foo from bar.


Public Class Foo
Inherits Bar
Publuc Sub New()
.
.
.
.
.
End Class



And after this you can use Foo in your Codebehind.

I hope i helped you.
Please let me know if you get struck.


Thanks