| |||||||
LinkButton Control SyntaxASP.NET Syntax ASP.NET Syntax for Web Controls Creates a hyperlink-style button on the Web Forms page.
For information on the individual members of this class, see LinkButton in the class library. RemarksThe LinkButton control renders a link button on a Web Forms page. You can create either a submit button or a command button.
A submit button does not have a command name associated with the button and simply posts the Web page back to the server. By default, a LinkButton control is a submit button. You can provide an event handler for the Click event to programmatically control the actions performed when the submit button is clicked. A command button has a command name associated with the button, such as Sort, by setting the CommandName property. This allows you to create multiple LinkButton controls on a Web page and programmatically determine which LinkButton control is clicked. You can also use the CommandArgument property with a command button to provide additional information about the command to perform, such as Ascending. You can provide an event handler for the Command event to programmatically control the actions performed when the command button is clicked.
Syntax ExampleThe below code snippet demonstrates how to use a LinkButton control to display a message when the control is clicked. Within the <head> of a Web Forms page:
Within the <body> of a Web Forms page: <form runat=server>
<asp:LinkButton id="LinkButton1" Text = "Click Me"
onClick = "LinkButtonClickHandler" runat="server" />
<p><asp:Label id="msgLabel" runat=server />
</form>
See AlsoLinkButton Class Button Web Server Controls |
| ||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme