articles

LinkButton in ASP.Net

Pushpendra Singh 7418 12-Oct-2010

The LinkButton control is used to create a hyperlink button.

The LinkButton control has the same appearance as a HyperLink control, but has the same functionality as a Button control.

<asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>

LinkButton in ASP.Net

When user clicks on a Linkbutton then click event of Link Button will fire.

You can provide an event handler for the Click event to programmatically control the actions performed when the button is clicked.

<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Label1.Text = "Hello";
    }

Here, when you click the linkButton then it will display message “Hello” in Label1

LinkButton in ASP.Net

We can change the LinkButton appearance

<asp:LinkButton ID="LinkButton1" runat="server" Font-Bold="True" 
Font-Italic="True" Font-Names="Arial" Font-Size="Larger" Font-Strikeout="False"Font-Underline="False" ForeColor="#FF6600">LinkButton</asp:LinkButton>


LinkButton in ASP.Net LinkButton in ASP.Net


Updated 04-Mar-2020

Leave Comment

Comments

Liked By