Sample code as follows:MyClass1.aspx.cs
----------------------------------------------------------
namespace Proj1.Folder1
class MyClass1
{
public static string Method1()
{
return "This is Mothod1 in MyClass1";
}
}
}MyClass2.aspx.cs
----------------------------------------------------------
namespace Proj1.Folder1
class MyClass2
{
public static string Method2()
{
string myString;
myString = MyClass1.Mothod1;
Response.Write(myString);
}
}
}
----------------------------------------------------------
Output result:
>This is Mothod1 in MyClass1
----------------------------------------------------------
namespace Proj1.Folder1
class MyClass1
{
public static string Method1()
{
return "This is Mothod1 in MyClass1";
}
}
}MyClass2.aspx.cs
----------------------------------------------------------
namespace Proj1.Folder1
class MyClass2
{
public static string Method2()
{
string myString;
myString = MyClass1.Mothod1;
Response.Write(myString);
}
}
}
----------------------------------------------------------
Output result:
>This is Mothod1 in MyClass1
----------------------------------------------------------
namespace Proj1.Folder1
class MyClass2
{
//public static string Method2()
// ERROR, Method2 copied from Method1(above), so..., change it as follow line :)
private void Page_Load(object sender,...)
{
string myString;
myString = MyClass1.Mothod1;
Response.Write(myString);
}
}
}