怪了怪了,郁闷死我了,真的要死了`````
private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
//判断验证码输入是否正确
if(Request.Cookies["CheckCode"] == null)
{
Response.Write("<script>alert('您的浏览器设置已被禁用 Cookies,您必须设置浏览器允许使用 Cookies 选项后才能使用本系统。')</script>");
//txtUserName.Text = "您的浏览器设置已被禁用 Cookies,您必须设置浏览器允许使用 Cookies 选项后才能使用本系统。";
//txtUserName.Visible = true;
return;
}
if(this.txtUserName.Text=="")
{
Response.Write("<script>alert('请输入用户名!')</script>");
return;
}
if(this.txtUserPass.Text=="")
{
Response.Write("<script>alert('请输入密码!')</script>");
return;
}
if(String.Compare(Request.Cookies["CheckCode"].Value, txtCheckCode.Text, true) != 0)
{
Response.Write("<script>alert('验证码输入有误,请输入正确的验证码。')</script>");
//txtUserName.Text = "验证码错误,请输入正确的验证码。";
//txtUserName.Visible = true;
return;
}
Operate op=new Operate();
if(op.Login(this.txtUserName.Text,this.txtUserPass.Text,"普通用户").ToString()=="0")
{
Session["LoginUser"]=this.txtUserName.Text.ToString();
this.Disp_UserMessage();
this.Panel1.Visible=false;
this.Panel2.Visible=true;
}
else
{
Response.Redirect("/ResConfer.aspx");
}
}
为什么我要文本框中输入汉字的时候就会提示 请输入用户名 而难证控件确没通过