例如:
protected void Page_Load(object sender, EventArgs e)
{
//.net1.1
Button1.Attributes.Add("onclick", "this.disabled=true;" + this.GetPostBackEventReference(this.Button1));
//.net 2.0以上
Button1.Attributes.Add("onclick", "this.disabled=true;" + this.ClientScript.GetPostBackEventReference(Button1, ""));
}
为了测试,我们可以建立一个页面,加入一个btnAdd按钮
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddAndEditUser.aspx.cs" Inherits="AddUser" %><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>添加和编辑页面示例</title>
</head>
<body>
<form >http://www.jb51.net/article/16925.htm

相关文章:

  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2021-06-28
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2021-08-06
  • 2021-08-09
  • 2021-08-28
  • 2021-10-16
  • 2022-12-23
相关资源
相似解决方案