修正了一下,再试试看!L@_@K    <script type="text/javascript">
    function Check()
    {
        if (document.getElementById("TextBox1").value == "")
        {
            alert('输入不能为空!');
            document.getElementById("TextBox1").focus();
            return false;
        }
    }
    </script>代码中这样写
    protected void Page_Load(object sender, EventArgs e)
    {
        this.TextBox1.Attributes.Add("onclick","return Check();");
    }