Using the HyperLink ControlThe HyperLink control enables you to create a link to a page. Unlike the LinkButton control, the HyperLink control does not submit a form to a server. For example, the page in Listing 2.32 displays a hyperlink that randomly links to a page in your application. Listing 2.32. ShowHyperLink.aspx
In the Page_Load event handler in Listing 2.32, a random file name from the current application is assigned to the NavigateUrl property of the HyperLink control. The HyperLink control supports the following properties (this is not a complete list):
Notice that you can specify an image for the HyperLink control by setting the ImageUrl property. If you set both the Text and ImageUrl properties, then the ImageUrl property takes precedence. |