ASP.NET Namespace Help

I’m not really a ASP.NET programmer, but i am learning.

Here’s my question. IF you had a set of code that was written in ASP.NET 2.0 and used a specific namespace and used @Import command in the header of your page, BUT you did not have any of the code that defined the namespace, how would approach building a development server that would use this namespace?

What page would you define the namespace ?
How would you specify the value the a variable contained in this namespace?

I have some templates but they use a specific namespace. I want to setup this same namespace on my server so i can preview the code.

I’ve downloaded and installed the Visual Studio Express 2010 tool (great free app). Its helpful, but I am a little confused.

Trying to put the pieces of the puzzle together. Thanks in advance for any suggestions you have.

  1. Well, it depends on what type getMyVars returns. var var1 = myVars.getMyVars(“var1”);

  2. I cannot tell you what it is, without seing it in the assembly. It could be a class

  3. getMyVars is probably a method. Yes, you can have a class within a class

  4. You can use var as I said above in 1. VS express and full version can do all the same things with regards to websites

  1. By type you mean “string”, “int” etc. right? I think in this case var1 is an int.

  2. What are the possible things it could be? I think its a class, but I don’t know.

  3. Agreed. How would i write a method that would specify the values of all of the variables in my page like “var1” for example and then be able to have the values outputted on my page. Of course, doing all of this would just simply allow the ASPX pages to run without displaying any errors because its missing.

  4. Where would i specify “var var1 = myVars.getMyVars(“var1”);”? Does that just initiate the variable making it ready to receive a value? After that would i put something something public string var1 = “9.99”; ???

Thanks again very much for your help.


  1. Yes, so then int var1 = myVars.getMyVars(“var1”);

  2. Could be a namespace or a class by the looks of it.

  3. Not sure what ur asking

  4. That initiates var1 with the value and return type of the method. Once it is of one type, you cannot make it another.

That is basic syntax rules. I think it would be best to take a step back and do a little learning of C#. Also, this assembly must have some sort of documentation, as it is very hard for us to help without knowing what is in it. And what the methods are and what they return and what you want to do with them.

You declare a var like this:

int i = 0;
string s = “string”;

But you cannot say string i = “0” aftwards as i is already declared as an int.

IF there is no code-behind page used, then where do you think they would be defining the namespace?

I think there is some global page that effects all sites on the server.

This is where i am lost.

My question i have are as follows:

  1. How do i define the variable “var1” that is contained in the ijwebsites.apps.webdev.mycfmx.class namespace?

  2. What is myVars? Is it a class?

  3. What is getMyVars? Is that a class and can you have a class inside of another class?

  4. I’m using Visual Studio Express 2010. I don’t have VS 2010. I think i should be able to succeed in making a template that writes out all of these values. I just need a little help in the proper syntax to use to define the variables. I’ve inherited the code and i want to get this running so i can view the pages on our server.

If you are using:


You do not need to import the namespace, as its being used there. But if you import it, you can just do this:


I can’t share the exact namespace. I will give a generic version but i am hoping it will shed some light on my problem.

<%@ Import Namespace=“ijwebsites.apps.webdev.mycfmx.class” %>

I modified it slightly but thats basically what i am looking at.

I see in the page a variable is called like this:


I get that the variable “var1” is probly defined somehow in the namespace or maybe there is a control somewhere that loads “var1” from a database?

thanks again.

Might help to know what namespace you are @Importing here . . .