Click here to Skip to main content
15,891,763 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi every body,

In my project that i have cs file inside code_app folder
and i have web page file inside specific folder in the project called Operator folder
I want to call specific method found in cs file inside code_app folder from my web page
but when i try to write the class name that contain the method it not appear for me in code page

If any one understand me please answer me
It is big problem for me

If any one need more explain about my problem pleaase tell me
Posted
Updated 12-Oct-10 15:07pm
v2

Make sure the following things:

1. The class (cs file) inside the App_Code folder compiles.
2. The class is public.
3. If the class has a namespace, make sure it is imported in the codebehind file with the "using" statement.
4. Make sure the methods of the class file are public.

Hopefully, your problem will be resolved.
 
Share this answer
 
Comments
MrLonely_2 12-Oct-10 22:36pm    
Thanks ,
The class was internal and when i make it public it solve the problem but,
But i have desktop application the class is internal and no problem.
My question is that why in desktop application but in web application there is problem.
thanks again
Al-Farooque Shubho 12-Oct-10 22:40pm    
If a class is "internal", this class will be visible only within the assembly and no external assembly will not be able to access the class. Now, if you write any class within the "App_Code" folder, a separate assembly is created and compiled automatically. So, in this case, the class wasn't visible from the codebehind class.

In your desktop application, I guess the class was within a single assembly (Not written within a separate class library) and hence you were able to access it.

Cheers.
MrLonely_2 12-Oct-10 22:45pm    
Thanks for your answer,
I am understand now that if you write any class within the "App_Code" folder, a separate assembly is created and compiled automatically.
Thank youuuuuuuuuu
As you have so aptly mentioned in the subject of this question, is the namespace included in the web page. If they are separate dll's, is the dll reference added?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900