当前位置: 代码迷 >> ASP.NET >> 刚才那个有关问题.再给30分.
  详细解决方案

刚才那个有关问题.再给30分.

热度:3081   发布时间:2013-02-25 00:00:00.0
刚才那个问题.再给30分.急
private   string   _code;
        public   string   CheckCode
        {
                get
                {
                        try
                        {
                                _code   =   Session[ "checkcode "].ToString();
                                return   _code;
                        }
                        catch
                        {
                                return   " ";
                        }
                }
        }                        
        protected   void   Button1_Click(object   sender,   EventArgs   e)
        {
                Response.Write(_code);//什么也没有
                Response.Write(session[ "checkcode "].Tostring());//输出正确
        }

------解决方案--------------------------------------------------------
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(this.CheckCode);//什么也没有
Response.Write(session[ "checkcode "].Tostring());//输出正确
}
  相关解决方案