<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login1.aspx.cs" Inherits="extdemo.pages.login1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>LOGIN</title>
<script runat="server">
protected void verycode()
{
string u = this.txtUsername.Text;
string p = this.txtPassword.Text;
if (u == "admin" && p == "admin")
{
Window1.Hide();
// Session["user"] = "admin";
X.MessageBox.Alert("info", "success").Show();
}
else
{
X.MessageBox.Alert("info", "failure").Show();
}
}
protected void btnLogin_Click(object sender, DirectEventArgs e)
{
verycode();
}
</script>
<script>
Ext.getDoc().on('keydown', function (e) {
if (e.getKey() == e.ENTER) {
App.btnLogin.fireEvent("click", btnLogin);
}
});
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" >
</ext:ResourceManager>
<ext:Window
ID="Window1"
runat="server"
Closable="false"
Resizable="false"
Height="150"
Icon="Lock"
Title="user login"
Draggable="false"
Width="350"
Modal="true"
BodyPadding="5"
Layout="FormLayout">
<Items>
<ext:TextField
ID="txtUsername"
runat="server"
FieldLabel="username"
AllowBlank="false"
BlankText="please input username" FocusOnToFront="true"
/>
<ext:TextField
ID="txtPassword"
runat="server"
InputType="Password"
FieldLabel="password"
AllowBlank="false"
BlankText="please input password"
/>
</Items>
<Buttons>
<ext:Button ID="btnLogin" runat="server" Text="login" Icon="Accept">
<DirectEvents>
<Click OnEvent="btnLogin_Click">
<EventMask ShowMask="true" Msg="login..." MinDelay="1000" />
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:Window>
</form>
</body>
</html>
here is my code , when I input wrong username and password , then pop ALERT window then i press "enter" key , i just want to close the alert window, but now it can show "login ..." again