问题描述
protectedvoidFormView1_ItemCommand(objectsender,FormViewCommandEventArgse){if(e.CommandName=="pass"){SqlConnectioncn=newSqlConnection("server=KAYAK;uid=sadb;pwd=1234;database=chuankouInfo");cn.Open();SqlCommandcom=newSqlCommand("updateApplication_TablesetState=2whereApply_ID=@Apply_ID",cn);com.Parameters.Add("@Apply_ID",SqlDbType.Int).Value=((Label)FormView1.FindControl("Apply_IDLabel")).Text;com.ExecuteNonQuery();cn.Close();FormView1.DataSourceID="SqlDataSource1";((Button)FormView1.FindControl("Button4")).Enabled=false;((Button)FormView1.FindControl("Button5")).Enabled=false;}if(e.CommandName=="unpass"){SqlConnectioncn=newSqlConnection("server=KAYAK;uid=sadb;pwd=1234;database=chuankouInfo");cn.Open();SqlCommandcom=newSqlCommand("updateApplication_TablesetState=3whereApply_ID=@Apply_ID",cn);com.Parameters.Add("@Apply_ID",SqlDbType.Int).Value=((Label)FormView1.FindControl("Apply_IDLabel")).Text;com.ExecuteNonQuery();cn.Close();FormView1.DataSourceID="SqlDataSource1";((Button)FormView1.FindControl("Button5")).Enabled=false;((Button)FormView1.FindControl("Button4")).Enabled=false;}}为什么最后两行隐藏button的控件没有实现?是不是因为重新绑定数据的原因?请高手指点一下
解决方案
解决方案二:
a?没人啊?高手都在哪里啊