【发布时间】:2010-12-06 12:50:08
【问题描述】:
我有两节课
第 1 课。
public class BaseContentPage : System.Web.UI.Page
{
}
第 2 类。
public class BaseUserControl : System.Web.UI.UserControl
{
}
现在我希望他们知道这个类。
public class BaseCommon
{
public string Variable1 { get; set; }
public string Variable2 { get; set; }
public string Variable3 { get; set; }
}
我目前的做法是让 BaseCommon 类的变量像这样静态
public static string Variable1 { get; set; }
public static string Variable2 { get; set; }
public static string Variable3 { get; set; }
我还能怎么做?
【问题讨论】:
标签: c# class inheritance static base