Solved

app_code folder accessing classes, asp.net vb.net

Posted on 2010-09-10
8
696 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

22 Experts available now in Live!

Get 1:1 Help Now