Solved

app_code folder accessing classes, asp.net vb.net

Posted on 2010-09-10
8
698 Views
Last Modified: 2012-05-10
i have some web page in the root directory of the solution. i have some classes inside the app_code folder.

I am unable to access these classes that are inside the app_code from the webpages in the root dirctory. should I add a namespace or how can I make these accessible. I am working in asp.net 4.0, vb.net. please help thanks
0
Comment
Question by:TrialUser
  • 4
  • 2
  • 2
8 Comments
 
LVL 9

Expert Comment

by:richard_hughes
ID: 33647302
Hello TrialUser

Are your classes marked as public? Adding a namespace to them can also be of help.

Thanks,

Richard Hughes
0
 

Author Comment

by:TrialUser
ID: 33647345
yes the classes are marked public. i tried adding a namespace to the class as

namespace test1
put my class here
end namespace

then in my webform did
import test1

however i still cant access these clases. any suggestions or ideas would b great

0
 
LVL 8

Expert Comment

by:Mohit Vijay
ID: 33647502
Is your all classes/pages in same name space.

Example
if you hve your .cs pages (outside of app_code) have NameSpace MySpace1

then your app_code folder should hve parent namespace MySpace1
and underit, you can define its own namespace.

Yes All classes should be public.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 8

Accepted Solution

by:
Mohit Vijay earned 500 total points
ID: 33647527
Remember: App_Code is for Web site only on Project...
Are you using Project or WebSite (what you create it as in start?)
0
 

Author Comment

by:TrialUser
ID: 33647644
I created it as Project not website. Can i not use app_code? please help thanks.
0
 
LVL 9

Expert Comment

by:richard_hughes
ID: 33647671
OK

You need to create a new ASP .NET website.

Have a look here as to how:

File -> New -> Website

Then select an appropriate type like in the image attached.

Thanks,

Richard Hughes
Capture.PNG
0
 
LVL 8

Expert Comment

by:Mohit Vijay
ID: 33647679
no it will work website only
0
 
LVL 8

Expert Comment

by:Mohit Vijay
ID: 33647706
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now