In the past, I have not really used namespaces, but in this project I am using SourceSafe which requires a project, which puts everything in namespaces…
In the past, I have just been able to make a public static class in the App_Code folder and access it frorm anywhere in my application, but now I cant seem to do that.
For example, my default.aspx.cs looks like this:
namespace Personnel_Database { public partial class _default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { utils.someFunction();//this does not work
and my utils.cs class looks like this:
namespace Personnel_Database.App_Code { public static class utils {
How can I have it so I can call util.someMethod() inside of my default? Am I wrong assuming it is a namespace problem? I just want utils.cs to be available globally inside namespace Personnel_Database
Either you include the namespace with a using directive:
Or you use the fully quallified name of the utils class (including its namespace), e.g: