我怎么能做一个代码,当我点击asp.net上的按钮,引导或消息框的警告消息出现?asp.net上的按钮事件引导警报
protected void ButtonLogin_Click(object sender, EventArgs e)
{
//TextBoxEmail.Text = DateTime.Now.ToString();
string UserName = TextBoxEmail.Text.Trim();
string password = TextBoxPassword.Text.Trim();
OracleConnection conn = new OracleConnection(strConnString);
conn.Open();
sql = "select password from userlogin where USERNAME = '" + UserName + "' and password ='" + password + "' ";
cmd = new OracleCommand(sql, conn);
// orada=new OracleDataAdapter(com.CommandText,conn);
// cmd.CommandType = CommandType.Text;
dr = cmd.ExecuteReader();
//dr.Read();
if (dr.HasRows)
{
Label1.Text = "";
Response.Redirect("Details.aspx");
}
else
{
Label1.Text = "No data found...";
conn.Close();
}
}
}
以上,在其他部分:
else
{
Label1.Text = "No data found...";
conn.Close();
}
当用户名和密码不匹配,我希望出现在网站上的自举警告或消息框:“密码不正确” 。我怎么能这样做?
亲爱的Webruster,谢谢你的回答。请你帮我理解这条线是什么意思在jQuery中$('#<%= ButtonLogin.ClientID%>' –
@ALAMIN在asp.net中我们不应该直接给idname,当服务器控件转换为html有不同的id,比你给的所以,以便应用该id,上面提到将转换为html表单后得到id – Webruster
非常感谢您的答案。因为我是新手,我想学习这种转换程序分步实施,请你建议任何链路或资源 –