[My Blog] | [Code Projects Home] | [skmMenu] | [RssFeed]

skmLinkButton Demo

The following demo illustrates how to use the skmLinkButton control to add status bar text messages when mousing over a LinkButton. Additionally, the skmLinkButton allows for confirm messages.

NOTE: skmLinkButton was updated to version 2.0 on August 23rd, 2005. The articles on 4GuysFromRolla.com covering skmLinkButton can be found at:

The main change is version 2.0 was moving the JavaScript normally injected into the Href attribute into the Onclick attribute. The benefit of this is that when opening a LinkButton in a new window - by either right-clicking on the link and choosing to Open in a New Window, or by SHIFT+clicking the link - the new window simply loads the existing page, rather than trying to navigate to the JavaScript (thereby resulting in a blank page and/or JavaScript error message).

As of October, 2004, the status bar text will not work in Mozilla FireFox 1.0 PR by default. This is because Mozilla FireFox 1.0 PR, by default, disables JavaScript changes to the browser's status bar. This setting can be changed by entering about:config in Mozilla's address bar and changing the dom.disable_window_status_change setting to false.


My Blog

Do You Want to Click Me?

Choose the Status Bar Text Below!


Page Source Code
<%@ Register TagPrefix="skm" Namespace="skmExtendedControls" Assembly="skmExtendedControls" %>

<script language="C#" runat="Server">

  void gotoBlog(object sender, EventArgs e)
  {
    Response.Redirect("http://scottonwriting.net/sowBlog/");
  }

  void confirmedClick(object sender, EventArgs e)
  {
    Response.Write("<h2>You must have been pretty darn sure!</h2>");
  }

  void setStatusBarText(object sender, EventArgs e)
  {
    customStatusBarText.StatusBarText = statusBarText.Text;
  }

</script>

<form runat="server">
	<skm:skmLinkButton runat="server" ShowStatusBarText="True" Text="My Blog" StatusBarText="Visit ScottOnWriting.NET!" OnClick="gotoBlog" />
	<p>
	<skm:skmLinkButton runat="server" ConfirmMessage="Are you sure!" ShowConfirm="true" Text="Do You Want to Click Me?" OnClick="confirmedClick" />
	<p>
	<skm:skmLinkButton runat="server" id="customStatusBarText" ShowStatusBarText="True" Text="Choose the Status Bar Text Below!" />
	<p>
	<asp:TextBox runat="server" id="statusBarText" />
	<asp:Button runat="server" Text="Set Status Bar Text" OnClick="setStatusBarText" />
</form>


[Return to the article...]