日期:2014-05-18 浏览次数:20415 次
bool flag=true; DataTable source=ds2.Tables[0]; for(int i=0;i<source.Rows.Count;i++) { double salePrice=Convert.ToDouble(source.Rows[i][9].ToString()); double costPrice=Convert.ToDouble(source.Rows[i][8].ToString()); double rate=salePrice/costPrice; if(rate<1||rate>99) { flag=false; break; } } if(flag==false) { Response.Write("<script language=jscript>alert('asdfasdf')</script>"); }
Response.Write("<script language=jscript>alert('asdfasdf')</script>"); Response.End();
------解决方案--------------------
if(flag==false) { Response.Write("<script language=jscript>alert('asdfasdf')</script>"); Response.End();//这样就执行了 }
------解决方案--------------------
Response.Write("<script>alert('asdfasdf')</script>"); Response.End();