using System;
using System.IO;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class admin_login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {    }
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (vali_box.Text == Session["ValidateCode"].ToString())
        {
            TextBox1.Text = "正确!";
        }
        else
            TextBox1.Text = "错误!";
    }
}
}
怎么编译器有这个错误的呢??
-------------------------------------------------------------------------
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: CS1518: 应输入 class、delegate、enum、interface 或 struct源错误: 行 17:     }
行 18:         }
行 19:     protected void Button1_Click(object sender, EventArgs e)
行 20:     {
行 21:         if (vali_box.Text == Session["ValidateCode"].ToString())
 

解决方案 »

  1.   

    public partial class admin_login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {    }
            }//多了一个括号
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (vali_box.Text == Session["ValidateCode"].ToString())
            {
                TextBox1.Text = "正确!";
            }
            else
                TextBox1.Text = "错误!";
        }
    }
    }//多了一个括号
      

  2.   

    public partial class admin_login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {    }
            }--------这个括号没有对应的应该是多的
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (vali_box.Text == Session["ValidateCode"].ToString())
            {
                TextBox1.Text = "正确!";
            }
            else
                TextBox1.Text = "错误!";
        }
    }-------------这个括号没对应的,也是多的
    }其他的代码没有语法错误
      

  3.   

    public partial class admin_login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {    }
            }--------这个括号没有对应的应该是多的
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (vali_box.Text == Session["ValidateCode"].ToString())
            {
                TextBox1.Text = "正确!";
            }
            else
                TextBox1.Text = "错误!";
        }
    }
    }-------------这个括号没对应的,也是多的
    其他的代码没有语法错误