Linkbutton control example
Linkbutton control example
The LinkButton control is used to create a hyperlink button.The LinkButton Web server control is a hyperlink style button control. It looks like a hyperlink control but is actually a button control with click and command events.LinkButton control is a control just like a Button control along with the flexibility to make it look like a Hyperlink. It implements an anchor tag that uses only ASP.NET postback mechanism to post the data on the server. Despite being a hyperlink, you can't specify the target URL. There is no UserSubmitBehavior property like Button control with this control.
..........Designing code............................................
....................................................................
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
Untitled Page
.................................................................................................cs code................................
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Label1.Visible = true;
Label1.Text = "i am link button";
}
}
.......................................................................