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

First time at using shared code in App_Code directory

Hi,

I have been using the following tutorials:

http://quickstarts.asp.net/QuickStar...ages/code.aspx

It would appear that it is instructing me to simply to create an
App_Code folder and place the CustomClass.vb file there. I have done
so and using the exact same code from the tutorial but it tells me the
class is undefined:

http://biztuk.brinkster.net/CodeFolder_vb.aspx

Obviously Im a little too new to this but do I need to do something
where the app knows that classes are contained there? Thanks

Burnsy

Feb 15 '07 #1
3 5545
Is the class (or classes in this case) in a namespace? If it is, you'd need
to import than namespace on the using page.

And you haven't specified any other code sub directories?

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
<bi******@yahoo.co.ukwrote in message
news:11********************@v45g2000cwv.googlegrou ps.com...
Hi,

I have been using the following tutorials:

http://quickstarts.asp.net/QuickStar...ages/code.aspx

It would appear that it is instructing me to simply to create an
App_Code folder and place the CustomClass.vb file there. I have done
so and using the exact same code from the tutorial but it tells me the
class is undefined:

http://biztuk.brinkster.net/CodeFolder_vb.aspx

Obviously Im a little too new to this but do I need to do something
where the app knows that classes are contained there? Thanks

Burnsy
Feb 15 '07 #2
On Feb 16, 4:12 am, "Teemu Keiski" <jot...@aspalliance.comwrote:
Is the class (or classes in this case) in a namespace? If it is, you'd need
to import than namespace on the using page.
Sorry, I was under the impression that you had folders that the
application would recognise and there was no need to define it in
every page. Is this not the case?

Also, how do I know if it is in the namespace?
And you haven't specified any other code sub directories?
Do I not only need to specify code sub-directories if I create other
ones besides App_Code? How do I specify these?

I only know what the tutorials have specified and maybe overlooked
some part. If there is anything that could be outlined that I should
check for please let me know.

Thanks

Burnsy

Feb 16 '07 #3
Namespace would mean that your classes are wrapper in namespace statement
like

Namespace MyNS

Public Class myTemp

End Class

End Namespace

If you are only using App_Code, then you don't need to configure anything.
It would e needed if you'd create separate folders under App_Code (for
example one for classes written in C# and one for classes in VB.NET)
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

<bi******@yahoo.co.ukwrote in message
news:11**********************@j27g2000cwj.googlegr oups.com...
On Feb 16, 4:12 am, "Teemu Keiski" <jot...@aspalliance.comwrote:
>Is the class (or classes in this case) in a namespace? If it is, you'd
need
to import than namespace on the using page.

Sorry, I was under the impression that you had folders that the
application would recognise and there was no need to define it in
every page. Is this not the case?

Also, how do I know if it is in the namespace?
>And you haven't specified any other code sub directories?

Do I not only need to specify code sub-directories if I create other
ones besides App_Code? How do I specify these?

I only know what the tutorials have specified and maybe overlooked
some part. If there is anything that could be outlined that I should
check for please let me know.

Thanks

Burnsy
Feb 18 '07 #4

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

Similar topics

1
by: HIK | last post by:
I am trying to write a class which has a function that loads a dataset, and performs and xslt tranformtion on the dataset and returns the resulting string. In asp.net 1.1 I was able to do most...
1
by: DaveP | last post by:
Hi, I've been using Web services for 4 years. I've just got VS2005. So I go in and create a Web Service. I can seethe code behind part in App_Code, but the asmx bit has ...
3
by: evian_spring | last post by:
Hi, I was under the impression it was possible to have two files written in different langage with the .NET 2.0 Framework? I have created a new web site, added one APP_CODE folder and under...
3
by: Jed | last post by:
I have a quick question about asp.net 2.0 compile options. Here's the scenario: I want to share some code among several websites on the same server, but I don't want to precompile anything. ...
3
by: Howard | last post by:
I have two websites that basically use the same data access layer. the code in the app_code folder are identical for these two website. Each has a different presentation layer (html stuff). It's a...
5
by: sck10 | last post by:
Hello, I am converting a class in the App_Code folder from c# to vb and am having problems calling the sub procedure. I have created a Sub called HidePanels in the class "General". When I try...
5
by: Daniel | last post by:
Hey guys I had a site in .net 1.1 and have just moved it to .net 2.0. A strange thing, in .net 1 when you create a project it puts it in a namespace, in 2.0 it doesn't? Also when in a...
2
by: Random | last post by:
Here's a design question I'm curious to know if anyone here has wrestled with before... I'm writing my data access methods in classes in the App_Code directory. I know that I can easily...
1
by: Frank Miverk | last post by:
Hi, I have a situation which I think is fairly common. 1. Public area 2. Secure area accessed via SSL e.g. MyWebsite/ /MySecureWebsite
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.