May 03, 2013, 11:00 AM
[CLOSED] how to call btn's click event on server by press "enter" key
<script>
Ext.getDoc().on('keydown', function (e) {
if (e.getKey() == e.ENTER) {
App.dircect.verycode(); //here I want to call btnLogin's click , how to do thanks.
}
});
</script>
<ext:Button ID="btnLogin" runat="server" Text="登陆" Icon="Accept">
<DirectEvents>
<Click OnEvent="btnLogin_Click">
<EventMask ShowMask="true" Msg="正在验证..." MinDelay="500" />
</Click>
</DirectEvents>
</ext:Button>
[DirectMethod]
protected void verycode()
{
string u = this.txtUsername.Text;
string p = this.txtPassword.Text;
if (u == "admin" && p == "XXX")
{
Session["user"] = "admin";
Response.Redirect("~/index.aspx");
}
else
{
X.MessageBox.Alert("提示", "登陆失败").Show();
}
}
protected void btnLogin_Click(object sender, DirectEventArgs e)
{
verycode();
}
why js show error:can not call method 'verycode' of underfinde
thanks.
Last edited by hdsoso; May 03, 2013 at 11:02 AM.