ASPNET 后台代码注册事件

    protected void Page_Load(objectsender, EventArgs e)

    {

 

        this.TextBox1.Attributes["onkeypress"] = "if(event.keyCode==13){"+ this.loginbnt.ClientID + ".click();return false;}";

 

    }

 

TextBox1.Attributes.Add("onkeydown","SubmitHuiCheEvent(Button1);");

C# 社区推荐