! - asp.net!
1) App_Data:
( > > ASP.Net)
( > > )
important! when you add these classes, you need to switch the assembly action to “compile” instead of “content” in the file properties, otherwise your code name will not recognize the imported namespaces.
2) Inside the class, create methods:
namespace applicationName.App_Code
{
public class ClassName
{
public string classMethod()
{
return "hello";
}
}
}
3) In the code form of any form, include this class header:
using applicationName.App_Code;
4) In the code code of this form, create an instance of the class:
ClassName classInstanceName = new ClassName(); //add this
5) Call the method in your codebehind form
classInstanceName.classMethod()
source
share