日期:2014-05-17 浏览次数:20381 次
Button btn = new Button();
btn.UseSubmitBehavior = false;
btn.ID = dr["ID"].ToString();
btn.Text = "删除";
btn.Click += new EventHandler(this.Del_Click);
//btn.Attributes.Add("onclick", "del(this.id)");
tc.Controls.Add(btn);
protected void Del_Click(object sender, EventArgs e)
{
//Button del = (Button)sender;
//string id = this.ID;
Response.Write("<script language='javascript'>alert('添加成功');</script>");
}
<script language="javascript" type="text/javascript">
function document.onkeydown() //网页内按下回车触发
{
if (event.keyCode == 13) {
document.getElementById("Button1").click();
return false;
}
}
</script>