Wednesday, September 1, 2010

LinkButton Server Control

by Emmaneale Mendu, Web Developer

The LinkButton server control is a variation of the Button control. It is basically the same except that the LinkButton control takes the form of a hyperlink. But, it isn't a typical hyperlink. When the end user clicks the link, it behaves like a button.


A LinkButton server control is constructed as follows.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Link Button Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">
Welcome to Cool Tuts.. Enjoy reading
</asp:LinkButton>
</div>
</form>
</body>
</html>


1 comment:

  1. its very nice. I appriciate if you update with latest .net 4.0.


    Thanks

    ReplyDelete