asp.net(c#)中消息窗口弹出代码,跪求了
protected void Button1_Click1(object sender, EventArgs e){
string text = this.TB_YZM.Text.ToString();
string chkcode = Request.Cookies["validateCookie"].Values["ChkCode"].ToString();
if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(chkcode))
{
if (!chkcode.Equals(chkcode.ToUpper()))
chkcode.ToUpper();
}
if (string.IsNullOrEmpty(text))
{
Button1.Attributes.Add("onclick", "javascript:return window.confirm('您输入的验证码为空,请重新输入!')");
}
if (!text.ToUpper().Trim().Equals(chkcode.Trim()))
{
Button1.Attributes.Add("onclick", "javascript:return window.confirm('输入的验证码错误,请重新输入!')");
}
if (text.ToUpper().Trim().Equals(chkcode.Trim()))
{
string yhm = TB_yhm.Text;
补充:由于字数的限制,不过这都足够了,我的本意是如果判断出验证码正确,则弹出对话框提示注册成功并关闭当前网页,如果验证码不正确或者为空,弹出对话框提示验证码错误或者为空,点了对话框中的确定后则停留在当前页面,继续注册,但是我的代码不行,希望高手指点一下,我是ASP新手
追问:谢谢你啊,那你现在给我的代码当我点过按钮的时候还有用吗?