The problem that I have (don't know what happened that cause it - it worked fine before):
I can't call a function in the App_Code
folder from an ashx
file (from a regular code behind C# file, it's working fine).
The class name is SendMail
and the method name is SendEmail
The handler file:
Class set to 'compile'
The method
What can cause that?
You have two classes named SendMail
, which is confusing both the compiler and you. I highly recommend more meaningful naming of your components.
If your classes are in two different namespaces, you can reference the target class explicitly by using its entire namespace. Something like:
YourNamespace.SendMail
Then you can call the method:
bool mailSent = YourNamespace.SendMail.SendEmail(firstName, lastName, ...