I'm experiencing this trouble that I can't figure out a solution.
I have a asp.net website project. A class library in app_code
folder named Libs.cs
(class name is Libs too).
The problem is :
if I want to reference the class in
*.aspx.cs
files, I have to set its Build Action property to : compile. This way I can reference the class without using theusing
Synxtax ( for example my namespace is IK, I don't have to include :using IK;
) , but I can't reference the class in the.aspx file
if I want to reference the class in
*.aspx
files, I have to set its Build Action property to :content
. This way I can reference the class using theimport
Syntax ( for example my namespace is IK, I have to include :<%@ Import Namespace="IK" %>
), but I can't reference the class in the.aspx.cs
file
So now if I want to reference the class, I have to choose , aspx
or aspx.cs
. I tried to google and everything, but without success.