Link to home
Start Free TrialLog in
Avatar of johnkainn
johnkainn

asked on

Call aspx.cs from AppCode

Is it possible to call a method in aspx.cs from Class in AppCode?
Avatar of silemone
silemone
Flag of United States of America image

read over this link:

http://www.velocityreviews.com/forums/t104413-20-appcode-folder-support-for-codebehind.html

if this is what yolu're talking about, the answer is yes.
Hello johnkainn,

I don't think that link applies to you (and it is not best practice either as discussed in the thread).

The simple answer is unfortunately no. Partly because of the reasons indicated in the thread mentioned above. You cannot instantiate the partial class (aspx.cs) without loading the whole page. If you have a function that needs to be used both from a page and from another class then it is better for you to move that function out of the page and into a common class where it can be called from wherever is appropriate.

Regards,

TimCottee
SOLUTION
Avatar of silemone
silemone
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial