JS代码
function confirmT()
    {
        count = "<%= resumecount %>"
        enddate = "<%= confirmText %>"
        if(enddate == "")
        {
            window.confirm("您的查看简历数为" + count + "次!您确定要收藏查看联系方式吗?")
        }
        else
        {
            window.confirm("您的查看简历数为" + count + "次!您的VIP有效期限为"+ enddate +"!您确定要收藏查看联系方式吗?")
        }
    }C#代码
this.btn_look.Attributes.Add("onclick", "return confirmT()");点击事件
        protected void btn_look_Click(object sender, EventArgs e)
        {
            Response.Write("sssssss");
        }为什么点击弹出的CONFIRM的取消按钮还是会执行btn_look_Click事件!请求帮助!

解决方案 »

  1.   

    function confirmT()
        {
            count = "<%= resumecount %>"
            enddate = "<%= confirmText %>"
            if(enddate == "")
            {
                if(window.confirm("您的查看简历数为" + count + "次!您确定要收藏查看联系方式吗?"))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                if(window.confirm("您的查看简历数为" + count + "次!您的VIP有效期限为"+ enddate +"!您确定要收藏查看联系方式吗?"))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
    OK搞定!
      

  2.   

     return  window.confirm("您的查看简历数为" + count + "次!您确定要收藏查看联系方式吗?") 
      

  3.   

    function confirmT() 
        { 
            count = " <%= resumecount %>" 
            enddate = " <%= confirmText %>" 
            if(enddate == "") 
            { 
                return (window.confirm("您的查看简历数为" + count + "次!您确定要收藏查看联系方式吗?")) 
                               
            else 
            { 
                return (window.confirm("您的查看简历数为" + count + "次!您的VIP有效期限为"+ enddate +"!您确定要收藏查看联系方式吗?")) 
            } 
        }