Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how i can access to code behind classes of project in other class(App_code)? I try, but i can not access to code behind class! it is possible?
Posted
Updated 27-May-11 6:13am
v3

1 solution

A code-behind class is nothing but a normal class.
So anything in a code-behind class would be accessible based on standard access modifiers (i.e. public, private etc).
 
Share this answer
 
Comments
[no name] 27-May-11 7:23am    
And I might add that this sounds very much like a very bad design. The page goes through its lifecycle at every request and exists only at that time. How and when is this other class supposed to access the page? In any scenario that I can think of and that would make sense it would be just the other way around, so that the page instantiates objects and calls their methods.
Sergey Alexandrovich Kryukov 27-May-11 14:37pm    
Speaking very formally, there is nothing wrong. In practice, your concern is very reasonable (and I know this OP and can imagine what's going on.)
--SA
Sergey Alexandrovich Kryukov 27-May-11 14:35pm    
...and also depending if method/property is static or not. My 5.
--SA
Abhinav S 27-May-11 14:48pm    
Thank you SA.

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