读书人

程序update 资料后,当资料正确的更新后

发布时间: 2012-03-03 15:33:03 作者: rapoo

程序update 资料后,当资料正确的更新后,怎样写让程序提示"更新成功!"
public void ShuKaFileUpdate()
{
SqlConnection Con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings[ "Con "]);
Con.Open();
SqlCommand cmd = new SqlCommand( "update nb_EMPLOYEE set BAIBIE= ' "+this.ddl_sort.SelectedValue.ToString()+ " ' where employeeid= ' "+this.tb_emp.Text+ " ' ",Con);

cmd.ExecuteNonQuery();

Con.Close();

}




[解决办法]
加句
Response.Write( " <script> alert( '更新成功! ') </script> ");
[解决办法]
楼上的点确定后字体变大了,最好加一个Literal然后

Listeral.Text= " <script> alert( '更新成功! ') </script> ";
[解决办法]
public void ShuKaFileUpdate()
{
SqlConnection Con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings[ "Con "]);
Con.Open();
SqlCommand cmd = new SqlCommand( "update nb_EMPLOYEE set BAIBIE= ' "+this.ddl_sort.SelectedValue.ToString()+ " ' where employeeid= ' "+this.tb_emp.Text+ " ' ",Con);

cmd.ExecuteNonQuery();
Response.Write( " <script> alert( '更新成功! ') </script> ");

Con.Close();

}

[解决办法]
最好还要重定向一下页面,否则你点刷新后就会看到问题了

读书人网 >asp.net

热点推荐