Please visit our sponsors !
LinkButton Control
Definition and Usage
The LinkButton control is used to create a hyperlink button.
Note: This control looks like a HyperLink control but has the same
functionality as the Button control!
Properties
Property |
Description |
CausesValidation |
By default, a page is validated when a Button control is
clicked. To prevent a page from being validated when clicking on a Button
control, set this property to "false" |
Command |
The command associated with the Command event |
CommandArgument |
Additional information about the command to perform |
id |
A unique id for the control |
OnClick |
The name of the function to be executed when the link is clicked |
runat |
Specifies that the control is a server control. Must
be set to "server" |
Text |
The text to display for the link |
Example 1
In the following example we declare one LinkButton
control and one Label control in an .aspx file. When the user clicks on the link, the lb_Click subroutine is executed. The
subroutine sends the text "You clicked the LinkButton control" to the Label control:
<script runat="server">
Sub lb_Click(sender As Object, e As EventArgs)
Label1.Text="You clicked the LinkButton control"
End Sub
</script>
<html>
<body>
<form runat="server">
<asp:LinkButton id="lb1" Text="Click Me"
OnClick="lb_Click" runat="server"/>
<p><asp:Label id="Label1" runat="server"/></p>
</form>
</body>
</html>
|
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|