Linkbutton control - DotNet and DataBase

Follow us on Facebook

SQL Server Mountain View Mountain View Mountain View

Thursday, 30 August 2018

Linkbutton control

Link button displays the button like a hyperlink. Use the text property to change the link text.
Link button works on the server side. We can have all the basic properties like font, style properties etc...
The difference between the Link button and Hyperlink is, Hyperlink works on the client side and the link button works on the server side. When we click on the Link button, the page will get the past back.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LinkbuttonControl.aspx.cs" Inherits="DotNetPractice.Controls.LinkbuttonControl" %>

<!DOCTYPE html>

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
            <asp:LinkButton ID="LinkButton1" OnClick="LinkButton1_Click" OnClientClick="alert('You clicked on link button')" runat="server">LinkButton</asp:LinkButton>


Code behind:

using System;

namespace DotNetPractice.Controls
    public partial class LinkbuttonControl : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)


        protected void LinkButton1_Click(object sender, EventArgs e)

No comments:

Post a comment


Get Updates On

Discussion updates

Straight Into Your INBOX!

Enter your email address to subscribe to this website and receive notifications of new posts by email.