Asp.net Disable postback LinkButton

Add fallowing code to your page_load HTML:

<asp:LinkButton ID="myLinkButton" runat="server" Text="Click Me"></asp:LinkButton>

Code:
protected void Page_Load(object sender, EventArgs e)
{
myLinkButton.Attributes.Add("onClick", "return false;");
}

Happy tips&tricks :)

Advertisements