What Is the Difference Between Asp:HyperLink &
Asp:LinkButton
|
Asp:HyperLink |
Navigation |
This Can use for navigation. Eg :- <asp:HyperLink ID=”HyperLink1″ |
PostBack |
The HyperLink will not PostBack your page to the server. It |
OnClick event |
The HyperLink doesn’t have |
|
Asp:LinkButton |
Navigation |
It also use for navigation. Eg:- <asp:LinkButton ID=”LinkButton1″ |
PostBack |
The LinkButton works exactly as a normal Button but it looks like a HyperLink (<a |
OnClick event |
We can Use OnClick event. |
So, if you’re asking yourself “which one should I use?“
Here’s the answer: if you need to do any operation with data
that’s on the page you will have to use a LinkButton (or a Button), but if you
just need to redirect the user to somewhere else go for a HyperLink (You will
avoid half roundtrip!).
E.g.
you want to avoid having Button
or LinkButton handlers with
just this code: Response.Redirect(“Default.aspx”);
And key
thing about SEO Friendly it is better to use HyperLink.