日期:2014-05-17  浏览次数:20710 次

“butLogin_Click”不是“ASP.default_aspx”的成员。D:\VS\website1\Default.aspx
<asp:Button ID="butLogin" runat="server" Text="登陆" onclick="butLogin_Click"/>
在default中已经写了onclick="butLogin_Click",但是还有这个问题怎么办呀????

下面是点击的代码:
 private void butLogin_Click(object sender, EventArgs e)
        {

            if (textName.Text != "" & textPass.Text != "")
            {
                SqlDataReader temDR = MyClass.getcom("select*from tb_Login where Name='" + textName.Text.Trim() + "'and Pass='" + textPass.Text.Trim() + "'");
                bool ifcom = temDR.Read();
                if (ifcom)
                {
                    App_Code.DB.Login_Name = textName.Text.Trim();
                    App_Code.DB.Login_ID = temDR.GetString(0);
                    App_Code.DB.My_con.Close();
                    App_Code.DB.My_con.Dispose();
                    App_Code.DB.Login_n = (int)(this.Tag);
                    this.Close();
                }

                else
                {
                    MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    textName.Text = "";
                    textPass.Text = "";