问题描述
protectedvoidPage_Load(objectsender,EventArgse){SqlConnectionstrcon=newSqlConnection("server=JIANG;database=sc;uid=sa;pwd=sa");strcon.Open();SqlDataAdaptersda=newSqlDataAdapter("select*fromnewswhereid="+Request["id"],strcon);DataSetds=newDataSet();sda.Fill(ds,"news");DataRowViewrowview=ds.Tables["news"].DefaultView[0];Title.Text=rowview["Title"].ToString();Details.Text=rowview["Details"].ToString();ds.Clear();strcon.Close();}protectedvoidButton2_Click(objectsender,EventArgse){stringsql="updatenewssetTitle='"+Title.Text.Trim()+"',Details='"+Details.Text.Trim()+"'whereid="+Request["id"];if(Db.ExecuteSql(sql)==1)Response.Write("<scriptlanguage=javascript>alert('修改成功');location='Admin_News.aspx'</script/>");}若把Page_Load里的代码删除刚能修改成功,,是什么问题啊,本人初学。。谢谢