Saturday, March 24, 2012

Newbie help! importing custom namespaces in IIS

Hi say for example if I had the following code: - how would I instantiate testclass in an aspx page. I am aware that I have to Import Namespace="tester" but do I compile test.cs into a library? and if so where on the webserver do I store it, (is stored in wwwroot\bin\)?

//test.cs
using System;
namespace tester{
public class testclass {
public String myString;
public void setMystring(){
myString = "hello world";
}
public String getString(){
return myString;
}
}

}

You help would be appreciated!
Thanks
abzI assume you aren't using Visual Studio .NET

You answered your own questions:

compile the cs file:

cs /t:library testclass.cs

and put it in your application's bin directory.

0 comments:

Post a Comment