后台处理confirm的返回结果

 
        protected void Button1_Click(object sender, EventArgs e)
        {
            
//当弹出confirm框的时候是否往下继续
            Response.Write(string.Format("<script>if(confirm('continue or not!')){{{0}}}else{{{1}}}</script>", WriteStr(),Cancel()));
        }

        
private static string WriteStr()
        {
            
return "alert('ok')";
        }

        
private static string Cancel()
        {
            
return "alert('canceled')";
        }
        
  
//根据前台反馈后台处理结果

  
    根据前台反馈后台处理结果
posted on 2011-03-11 10:39  .net小鸟  阅读(1522)  评论(0编辑  收藏  举报