Web Server Controls->ASP.NET LinkButton Control
2007-03-27 09:30
239 查看
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 |
Examples
LinkButtonASPX Source:
<script runat="server"> Sub lblClick(sender As Object, e As EventArgs) Label1.Text="You clicked the LinkButton control" End Sub </script> <html> <body> <form runat="server"> <asp:LinkButton Text="Click me!" OnClick="lblClick" runat="server" /> <p><asp:Label id="Label1" runat="server" /></p> </form> </body> </html> |
Output Result:
Click me! |
Click me! You clicked the LinkButton control |
相关文章推荐
- Web Server Controls->ASP.NET CheckBox Control
- Web Server Controls->ASP.NET Label Control
- Web Server Controls->ASP.NET RadioButtonList Control
- Web Server Controls->ASP.NET ListBox Control
- Web Server Controls->ASP.NET TableCell Control
- Web Server Controls->ASP.NET XML Control
- Web Server Controls->ASP.NET Literal Control
- Web Server Controls->ASP.NET TableRow Control
- Web Server Controls->ASP.NET AdRotator Control
- Web Server Controls->ASP.NET DropDownList Control
- Web Server Controls->ASP.NET HyperLink Control
- Web Server Controls->ASP.NET Panel Control
- Web Server Controls->ASP.NET Table Control
- Web server Controls->ASP.NET TextBox Control
- Web Server Controls->ASP.NET Button Control
- Web Server Controls->ASP.NET PlaceHolder Control
- Web Server Controls->ASP.NET Image Control
- Web Server Controls->ASP.NET ImageButton Control
- Web Server Controls->ASP.NET RadioButton Control
- ASP.NET AJAX Roadmap--Server Controls (11): Timer Control Overview