Click the AsyncLinkButton
The AsyncLinkButton is one of three AsyncWebControls that provides you with a simple interface that allows you to control each AsyncCallback and sort.
<%@ Register Assembly="AsyncControls" Namespace="DelvingWare.AsyncControls" TagPrefix="dw" %> <dw:AsyncButton runat="server" ID="btVisible" CssClass="greyButton" Text="Hide AsyncLinkButton" OnClick="btVisible_Click" /> <dw:AsyncButton runat="server" ID="btEnable" CssClass="greyButton" Text="Disable AsyncLinkButton" OnClick="btEnable_Click" /> <p/> <dw:AsyncLinkButton runat="server" ID="lnkMain" Text="Click Me" CssClass="lnkButton" OnClick="lnkMain_Click" OnMouseOut="lnkMain_MouseOut" OnMouseOver="lnkMain_MouseOver" /> <dw:AsyncLabel runat="server" ID="lblMain" RenderMode="Paragraph">Click the AsyncLinkButton</dw:AsyncLabel>
using System; using DelvingWare.AsyncControls; ... protected void lnkMain_MouseOut( object sender, AsyncEventArgs ae ) { // update the AsyncLabel lblMain.Text = "Mouse Out"; } protected void lnkMain_MouseOver( object sender, AsyncEventArgs ae ) { // update the AsyncLabel lblMain.Text = "Mouse Over"; } protected void lnkMain_Click( object sender, AsyncEventArgs ae ) { // update the AsyncLabel lblMain.Text = "Clicked"; } protected void btVisible_Click( object sender, AsyncEventArgs ae ) { // change the visibility lnkMain.Visible = !lnkMain.Visible; // update the AsyncButton text if ( lnkMain.Visible ) btVisible.Text = "Hide AsyncLinkButton"; else btVisible.Text = "Show AsyncLinkButton"; // update the AsyncLabel lblMain.Text = " "; } protected void btEnable_Click( object sender, AsyncEventArgs ae ) { // upate the enabled state lnkMain.Enabled = !lnkMain.Enabled; // update the AsyncButton text if ( lnkMain.Enabled ) btEnable.Text = "Disable AsyncLinkButton"; else btEnable.Text = "Enable AsyncLinkButton"; // update the AsyncLabel lblMain.Text = " " ; }
Imports System Imports DelvingWare.AsyncControls ... Protected Sub lnkMain_MouseOut(ByVal sender As Object, ByVal ae As AsyncEventArgs) ' update the AsyncLabel lblMain.Text = "Mouse Out" End Sub Protected Sub lnkMain_MouseOver(ByVal sender As Object, ByVal ae As AsyncEventArgs) ' update the AsyncLabel lblMain.Text = "Mouse Over" End Sub Protected Sub lnkMain_Click(ByVal sender As Object, ByVal ae As AsyncEventArgs) ' update the AsyncLabel lblMain.Text = "Clicked" End Sub Protected Sub btVisible_Click(ByVal sender As Object, ByVal ae As AsyncEventArgs) ' change the visibility lnkMain.Visible = Not lnkMain.Visible ' update the AsyncButton text If lnkMain.Visible Then btVisible.Text = "Hide AsyncLinkButton" Else btVisible.Text = "Show AsyncLinkButton" End If ' update the AsyncLabel lblMain.Text = " " End Sub Protected Sub btEnable_Click(ByVal sender As Object, ByVal ae As AsyncEventArgs) ' upate the enabled state lnkMain.Enabled = Not lnkMain.Enabled ' update the AsyncButton text If lnkMain.Enabled Then btEnable.Text = "Disable AsyncLinkButton" Else btEnable.Text = "Enable AsyncLinkButton" End If ' update the AsyncLabel lblMain.Text = " " End Sub
.lnkButton { color: #0054E2; } .lnkButton:hover { color: #00A8FF; text-decoration: none; } .lnkButton:active { color: Black; }