473,232 Members | 1,472 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,232 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 3848
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Stewart Midwinter | last post by:
I've got an app that creates an object in its main class (it also creates a GUI). My problem is that I need to pass this object, a list, to a dialog that is implemented as a second class. I want...
11
by: Bob Rock | last post by:
Hello, I'd like to be able to allow instanciation of a class (class Class_A) only from another class method (class Class_B). And I'd like to write the necessary code to enforce this behavior...
6
by: SearedIce | last post by:
Consider the following simplified hypothetical code: #include <iostream.h> class rabbit { public: rabbit() {x = 3; y = 3; /*code here to set field to 1*/} void runtocage(); int x;
4
by: Al Murphy | last post by:
I have a windows application called "WindowsApplication1". I have a variable of tyoe DataSet called myDataSet as shown below: namespace WindowsApplication1 { public class Form1 :...
5
by: M O J O | last post by:
Hi, I want to expose a enum from another class, is that possible and how? Here's an example Public Class ClassMaster Public Enum Colors
29
by: Michael D. Ober | last post by:
Is there any way to create a constant in a class that can be used both with an instantiated object and without. For example: dim ClassConst as string = myClass.ConstantString dim myObj = new...
4
by: Steve Goldman | last post by:
Even asking this question probably demonstrates that I have a fundamental misunderstanding of how values and references work in C#, but here goes: I'd like to assign a reference to an arbitrary...
3
by: drummond.ian | last post by:
Hello Everyone, This problem's been causing me a lot of trouble and I'm hoping somebody can help me out!! I have a dialog-based MFC application in visual studio 2003. I want to call a...
16
by: Mike | last post by:
Hi, I have a form with some controls, and a different class that needs to modify some control properties at run time. Hoy can I reference the from so I have access to its controls and...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.