StatCounter

View My Stats

Wednesday, February 6, 2008

Difference between Hyperlink and LinkButtton in ASp.NET

Difference between Hyperlink and LinkButtton in ASp.NET


To the Web page visitor, a HyperLink control and a LinkButton control look identical. However, there is a significant difference in functionality.

The HyperLink control immediately navigates to the target URL when the user clicks on the control. The form is not posted to the server.

The LinkButton control first posts the form to the server, then navigates to the URL. If you need to do any server-side processing before going to the target URL, use a LinkButton.

On the other hand, if there is no server-side processing necessary, don't waste a round trip and use the HyperLink control.

No comments: