在网上查资料,webform可以用这种方法实现, textbox1.Attributes.Add("onkeypress", "XXX"); textbox1.Attribute 你的当前访问异常,请进行认证后继续阅读剩余内容。 提交