NOFX August 13, 2008 Share NOFX Member August 13, 2008 So anyone familiar with this? I've been a Linux programmer for 3 years. They now have switched me over to MS environment and I going to start writing in C#. I don't know C#, but its very similar to Java, which I haven't used for over 3 years. I'm an awful programmer. I built my class diagram using the tool, I have all of my empty methods, but I can't figure out how to incorporate namespaces at all. I basically need to have an instance of a class global, so that any other classes can access this specific instance. So far, not so good. And where are the damn header files in C#? Link to comment Share on other sites More sharing options...
Unclean August 13, 2008 Share Unclean Member August 13, 2008 Whoa, you're learning C# from the bottom up, eh? Well, I'm technically supposed to be supporting C# apps (2k3 and 2k5 mainly), but I'm no expert. I might be able to help somewhat though. If I'm understanding what you're asking properly (you're using different terminology from what we use), you'd want to create a namespace file (call it "alohaworld.cs"). Then inside, you use syntax like this: namespace Whatever.whatevs { public class Whatevas { public dostuff() { //your code here } } } Then in your page code, you have a declaration at the top like so: <%@ Page language="c#" Codebehind="MyPage.aspx.cs" AutoEventWireup="false" Inherits="Whatever.whatevs" %> Make sure it's included in the project, and I *think* this will do what you want. Or it'll at least point you in the right direction hopefully. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now