473,748 Members | 8,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5564
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******** ************@v4 5g2000cwv.googl egroups.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...@aspalli ance.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.goo glegroups.com.. .
On Feb 16, 4:12 am, "Teemu Keiski" <jot...@aspalli ance.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
2479
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 of the work with the designer. 1. Create a dataadapter in the designer 2. generate a dataset 3. Create a proceedure that would reference the dataset. Fill it, convert the dataset to an xmldatadocument and then transform the xmldatdocument...
1
2076
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 CodeBehind="~/App_Code/Service.cs" and when I run it I get
3
1237
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 the APP_CODE folder I created two new item, one C# class and one VB class to test out if it was working. However I get the following error when I try to compile (Did I do
3
1613
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. The classic ASP directory structure would look like this. Physical files -> IIS Paths c:\wwwroot\website1 -> http://website1 c:\wwwroot\website2 -> http://website2
3
3097
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 lot of work keeping the two up to date when making changes in the data access layer. Im wondering if there is a way to let two websites share the same app_code or something to that effect. Has anyone done this Is this even possible? If so how do...
5
4042
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 to declare a new object of this type in my codebehind, I get the error: "Type 'HidePanels' is not defined". Any help with this would be appreciated. Thanks, sck10 code behind ===========
5
1353
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 namespace one form can't access methods in another, and when not in a namespace same issue.
2
1629
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 instantiate each class on a page and run it's functions to get my data from the database. However, I'm wondering if I could pick up performance if I made all the functions shared/static. Then I'm wondering if it would be worth it because of the design...
1
1871
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
8991
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9541
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9370
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6074
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3312
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
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.