TrialUser
asked on
app_code folder accessing classes, asp.net vb.net
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
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
ASKER
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
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
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I created it as Project not website. Can i not use app_code? please help thanks.
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
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
no it will work website only
Are your classes marked as public? Adding a namespace to them can also be of help.
Thanks,
Richard Hughes