473,320 Members | 1,858 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,320 software developers and data experts.

how do i include a class file?

Hello All,

Framework: Visual Studio 2005
I have a class file in my project with a namespace nmArticles
Now, I need to add this namespace into my article.aspx.cs page
so that i can accesss the methods available in the class file under the
namespace nmArticles
How do i do this??
Apparently, the method we use to call a class file in VS 2003 is not
working.
Is there anything that i am going wrong with?
Please help

Regards,
Kuldeep
Jun 28 '06 #1
5 2040
Kuldeep,
If you are using the WebSite solution arrangement as opposed to a Web
Application Project, you will probably need to have an APP_CODE folder and
put your class file there.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Kuldeep" wrote:
Hello All,

Framework: Visual Studio 2005
I have a class file in my project with a namespace nmArticles
Now, I need to add this namespace into my article.aspx.cs page
so that i can accesss the methods available in the class file under the
namespace nmArticles
How do i do this??
Apparently, the method we use to call a class file in VS 2003 is not
working.
Is there anything that i am going wrong with?
Please help

Regards,
Kuldeep

Jun 28 '06 #2
Peter,
Thanks for the response.
Even after doing that, I cant access the methods under that class
Am i missing something?

Kuldeep
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:16**********************************@microsof t.com...
Kuldeep,
If you are using the WebSite solution arrangement as opposed to a Web
Application Project, you will probably need to have an APP_CODE folder and
put your class file there.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Kuldeep" wrote:
Hello All,

Framework: Visual Studio 2005
I have a class file in my project with a namespace nmArticles
Now, I need to add this namespace into my article.aspx.cs page
so that i can accesss the methods available in the class file under the
namespace nmArticles
How do i do this??
Apparently, the method we use to call a class file in VS 2003 is not
working.
Is there anything that i am going wrong with?
Please help

Regards,
Kuldeep

Jun 29 '06 #3
Maybe you should consider compiling your classes to an assembly.
You could access any methods/properties in an assembly in a snap.

I don't even like thinking about placing source code in a server, anyway.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Kuldeep" <ku****************@hotmail.com> wrote in message
news:ub**************@TK2MSFTNGP04.phx.gbl...
Peter,
Thanks for the response.
Even after doing that, I cant access the methods under that class
Am i missing something?

Kuldeep
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:16**********************************@microsof t.com...
Kuldeep,
If you are using the WebSite solution arrangement as opposed to a Web
Application Project, you will probably need to have an APP_CODE folder and
put your class file there.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Kuldeep" wrote:
Hello All,

Framework: Visual Studio 2005
I have a class file in my project with a namespace nmArticles
Now, I need to add this namespace into my article.aspx.cs page
so that i can accesss the methods available in the class file under the
namespace nmArticles
How do i do this??
Apparently, the method we use to call a class file in VS 2003 is not
working.
Is there anything that i am going wrong with?
Please help

Regards,
Kuldeep


Jun 29 '06 #4
Putting the class file in the App_code folder doesn't change it's
namespace. You still have to specify the full class name or import the
namespace.

Kuldeep wrote:
Peter,
Thanks for the response.
Even after doing that, I cant access the methods under that class
Am i missing something?

Kuldeep
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:16**********************************@microsof t.com...
Kuldeep,
If you are using the WebSite solution arrangement as opposed to a Web
Application Project, you will probably need to have an APP_CODE folder and
put your class file there.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Kuldeep" wrote:
Hello All,

Framework: Visual Studio 2005
I have a class file in my project with a namespace nmArticles
Now, I need to add this namespace into my article.aspx.cs page
so that i can accesss the methods available in the class file under the
namespace nmArticles
How do i do this??
Apparently, the method we use to call a class file in VS 2003 is not
working.
Is there anything that i am going wrong with?
Please help

Regards,
Kuldeep


Jun 29 '06 #5
Thanks Goran!
Its working now
Kuldeep
"Göran Andersson" <gu***@guffa.com> wrote in message
news:uI*************@TK2MSFTNGP03.phx.gbl...
Putting the class file in the App_code folder doesn't change it's
namespace. You still have to specify the full class name or import the
namespace.

Kuldeep wrote:
Peter,
Thanks for the response.
Even after doing that, I cant access the methods under that class
Am i missing something?

Kuldeep
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in
message news:16**********************************@microsof t.com...
Kuldeep,
If you are using the WebSite solution arrangement as opposed to a Web
Application Project, you will probably need to have an APP_CODE folder
and
put your class file there.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Kuldeep" wrote:

Hello All,

Framework: Visual Studio 2005
I have a class file in my project with a namespace nmArticles
Now, I need to add this namespace into my article.aspx.cs page
so that i can accesss the methods available in the class file under the
namespace nmArticles
How do i do this??
Apparently, the method we use to call a class file in VS 2003 is not
working.
Is there anything that i am going wrong with?
Please help

Regards,
Kuldeep


Jun 29 '06 #6

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

Similar topics

9
by: Tom Cat | last post by:
Is there anything wrong with using a lot of include files? On one part of my website, I have a form. The page it posts data to, includes a different file based on some of the values. The...
1
by: Holden | last post by:
Hello, I am using Visual C++ 6.0 with Service Pack 5 installed and I have run into a problem that I haven't been able to figure out. I have written two classes and I want them to have pointers to...
10
by: Toke H?iland-J?rgensen | last post by:
Hello. I am quite new to the c++ language, and am still trying to learn it. I recently discovered how using include files would allow me to split up my code into smaller segments, instead of having...
28
by: Steven T. Hatton | last post by:
I will assume many people reading this would never create anything similar to the example below. So let me preface this with _*IF*_ you were in a situation where you had to chose between using...
18
by: Exits Funnel | last post by:
Hello, I'm a little confused about where I should include header files and was wondering whether there was some convention. Imagine I've written a class foo and put the definition in foo.h and...
60
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
6
by: Ben Taylor | last post by:
I've asked about includes before in this group in order to stop files being #included either twice or not at all, and somebody said to use extern keyword for global variables that need to be used...
14
by: Jon Rea | last post by:
I am currently cleaning up an application which was origainlly hashed together with speed of coding in mind and therefore contains quite a few "hacky" shortcuts. As part of this "revamping"...
5
by: Tio | last post by:
I have project in MFC(vc++) . There are files and classes: classes:dialog1,dialog2,aaa,bbb ---------------------- main.cpp --------------------- #include "mainfrm.h" #include "dialog1.h"...
2
by: joe t. | last post by:
My apologies, i'm not sure how to ask this question correctly, so i'll give the examples as i go. First, i *think* my problem is described here, but i may be misunderstanding:...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.