473,569 Members | 3,040 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3861
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*******@cana da.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.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******** *****@TK2MSFTNG P15.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*******@cana da.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.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
2067
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 to edit the contents of that list and then pass back the results to the first class. So my question is, can a method in one class change an object...
11
1671
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 even inside the same assembly where class Class_A and Class_B are defined. I've written the code that does this BUT I'd like to understand if this is...
6
1727
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
11907
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 : System.Windows.Forms.Form {
5
4924
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
1951
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 MyClass ClassConst = myObj.ConstantString Inside the class MyClass
4
2393
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 class member to another class member, so that I can later mutate the stored reference. I'd like to use this for an undo function - basically, when...
3
8624
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 function called "OnPrintMsg" from my dialog class called "MyAppDlg.h". The function needs to be called from another class called "Client.cpp". The Client...
16
4147
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 therefore being able to modify its properties?
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.