471,319 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

how to use my class from another class (.Net 2005)

hi

how to use my class from another class (.Net 2005)

i have web project (one page)

and created a class MyClass in separate file, the same folder, included in
project.

when i'm call MyClass in that web page... it dosn't see it.

thank you
Feb 8 '06 #1
4 3780
When you say "it doesn't see it", what do you mean?

Do you get a compiler error? What's the error? Could you post the code
for MyClass so we can see it?

Or does it compile OK but you get a run-time error? What's the error?

Feb 8 '06 #2
i'm getting compiler error.

"The type or namespace name 'MyClass' could not be found (are you missing a
using directive or an assembly reference?) "

two .cs files, when i use class name in another file, it doesn't work.
(blue line under the class name, and compiler error)

--
Sergiy Klokov
c. +1 602 703-4287
Skype ( edgerunner2005 )
Yahoo Messenger ( edgerunner2005 )

"Bruce Wood" <br*******@canada.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
When you say "it doesn't see it", what do you mean?

Do you get a compiler error? What's the error? Could you post the code
for MyClass so we can see it?

Or does it compile OK but you get a run-time error? What's the error?


Feb 8 '06 #3
It's a basic checking:

1. The namespace of both class are the same?
2. If not, are you placing the complete name of second class in the first
class call?
3. This is the only error? As Bruce said, you can have a compilation error
in this second class that makes the first class error happens...

"Serdge Kooleman" <Su***@web.de> wrote in message
news:uI*************@TK2MSFTNGP15.phx.gbl...
i'm getting compiler error.

"The type or namespace name 'MyClass' could not be found (are you missing
a using directive or an assembly reference?) "

two .cs files, when i use class name in another file, it doesn't work.
(blue line under the class name, and compiler error)

--
Sergiy Klokov
c. +1 602 703-4287
Skype ( edgerunner2005 )
Yahoo Messenger ( edgerunner2005 )

"Bruce Wood" <br*******@canada.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
When you say "it doesn't see it", what do you mean?

Do you get a compiler error? What's the error? Could you post the code
for MyClass so we can see it?

Or does it compile OK but you get a run-time error? What's the error?


Feb 8 '06 #4
file was in root folder.
when i put it in the App_Code it started to compile

thank you

--
It's a basic checking:

1. The namespace of both class are the same?
2. If not, are you placing the complete name of second class in the first
class call?
3. This is the only error? As Bruce said, you can have a compilation error
in this second class that makes the first class error happens...

i'm getting compiler error.

"The type or namespace name 'MyClass' could not be found (are you missing
a using directive or an assembly reference?) "

two .cs files, when i use class name in another file, it doesn't work.
(blue line under the class name, and compiler error)

--

Feb 9 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Stewart Midwinter | last post: by
6 posts views Thread by SearedIce | last post: by
5 posts views Thread by M O J O | last post: by
29 posts views Thread by Michael D. Ober | last post: by
3 posts views Thread by drummond.ian | last post: by
reply views Thread by rosydwin | last post: by

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.