<script language=javascript type="text/javascript">
<!--
function disableNew(bt)
{
bt.Enabled = false;
}
//-->
</script>
<asp:Button ID="bt_new" runat="server" OnClick="bt_new_Click" Text="New" Width="49px" />protected void Page_Load(object sender, EventArgs e)
{
bt_new.Attributes.Add("onclick", "disableNew(this);");
}不起作用,请问有何良策?
<!--
function disableNew(bt)
{
bt.Enabled = false;
}
//-->
</script>
<asp:Button ID="bt_new" runat="server" OnClick="bt_new_Click" Text="New" Width="49px" />protected void Page_Load(object sender, EventArgs e)
{
bt_new.Attributes.Add("onclick", "disableNew(this);");
}不起作用,请问有何良策?
bt_new.Attributes.Add("onclick", "disableNew(this.form."+bt_new.clientID+");return false;");
<!--
function dis(theId)
{
document.getElementById(theId).disabled = true;
}
//-->
</script><asp:Button ID="bt_new" runat="server" Text="Button" />protected void Page_Load(object sender, EventArgs e)
{
this.bt_new.Attributes.Add("onclick", "dis('" + this.bt_new.ClientID + "');");
}
<!--
function disableNew(bt)
{
bt.disabled = (bt.disabled) ? false : true;
}
//-->
</script>