日期:2014-05-18 浏览次数:20516 次
class class1 : System.Web.UI.Page { private string a { get{ if(ViewState["a"] != null) return (string)ViewState["a"]; return ""; } set{ ViewState["a"] = value; } } public class1() //构造函数定义 { a="你好"; } protected void Page_Load(object sender, EventArgs e) { class1 box = new class1(); //初始化sd,并且隐式调用构造函数 Response.Write(box.a); } }