Disable LinkButton on click
Posted on: Tue Jun 30 16:29:42 -0700 2009. Updated on: Tue Jun 30 16:32:27 -0700 2009.
Category: DotNet
Category: DotNet
Often we want to make sure a user does not click more than once on a particular function. Usually with things that write to the database or activate payment, we want to control this. You can use the following with a LinkButton or a standart asp.net Button.
protected void Page_Load(object sender, EventArgs e)
{
LinkButtonSave.Attributes.Add("OnClick", "this.disabled=true; this.onclick=function() { return false;}");
}
Note that this needs to be called from the codebehind, usually page_load works
Mon Aug 03 05:44:47 -0700 2009
Thanks! ;)
---------------------------------------------------