Import a class in ASP.NET
问题 I want to import a class that is in App_Code to use it in my aspx pages. How can I do it ? Thanks 回答1: Add the namespace you used to your codebehind file or aspx file(if not using code behind). using YourNamespace; //C# imports YourNamespace //VB or if not using codebehind <%@ Import Namespace="YourNamespace" %> 回答2: if your app_code class is in another namespace, add a using statement at the top of your code behind. Example: using MyCustomNamespace; EDIT: if using vb in your code behind: