VB.net Tutorials with Examples

VB.Net Projects

VB.Net Project 1

ASP.NET LinkButton Control
Previous Home Next

Link Button Control is similar to Button Control. Everything is similar in properties and events,except that user can see it as a Link.

Syntax Of Link Button

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

Properties

Properties Discription
AccessKey specify a key that navigates to the Button control.
CommandArgument specify a command argument that is passed to the Command event.
CommandName specify a command name that is passed to the Command event.
Enabled disable the LinkButton control.
OnClientClick specify a client-side script that executes when the LinkButton is clicked.
PostBackUrl post a form to a particular page.
TabIndex specify the tab order of the LinkButton control.
Text label the LinkButton control.
Focus set the initial form focus to the LinkButton control.

 

LinKButton Event

Event Discription
Click occurs when the LinkButton control is clicked by the user.
Command occurs when the LinkButton control is clicked and passes its associated CommandName and CommandArgument to the server side event handler.

.vb Code

Protected Sub LinkButton1_Click(ByVal sender As Object, 
ByVal e As System.EventArgs) Handles LinkButton1.Click
Label1.Text = "This is my Home Page"
End Sub
Protected Sub LinkButton2_Click(ByVal sender As Object, 
ByVal e As System.EventArgs) Handles LinkButton2.Click
Label1.Text = "My  Company name R4r TechSoft Solution "
End Sub
Protected Sub LinkButton3_Click(ByVal sender As Object, 
ByVal e As System.EventArgs) Handles LinkButton3.Click
Label1.Text = 
"My Name is Rituraj Tyagi And My Contact No... 9717009112"
End Sub

Output:

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: