Link , HyperLink and URL
URL :
A Uniform Resource Locator (URL), colloquially termed a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it
A URL has two main components:
- Protocol identifier: For the URL
http://example.com
, the protocol identifier ishttp
. (hypertext transfer protocol) - Resource name: For the URL
http://example.com
, the resource name isexample.com
.
Link & HyperLink:
Generally speaking both looks same.
A hyperlink control functions as a Web server control, but a link is simply the HTML control. The difference is mostly unnoticeable for the casual user, but it is important on the programming side.
When using a hyperlink control, the user is putting a programming event model with full features to use. All the simple link feature permits is an HTML anchor. Adding a runat="server" attribute to that control permits it to be accessed using server-side code. This attribute is necessary, whichever type of link the user has in mind.
On the practical side, another difference is that a hyperlink control navigates directly to a target URL when a user clicks on it, instead of posting the form on the server. So if there is no work to be done in the server side, we can use hyperlink.
Using a link posts that form right to the server first, before going to the URL. Therefore, a link is the better choice for those who need to complete some server-side processing before heading to the final URL destination.
So for hyperlink, we will be directly hitting the URL
For link, the job is done in the server side first.
Hope that helps!!!
Post a Comment