Using the HyperLink Control : HyperLink « Controls « ASP.NET Tutorial

Important properties of HyperLink control

Enabled:    disable the hyperlink.

ImageUrl:   an image for the hyperlink.

NavigateUrl:URL represented by the hyperlink.

Target:     open a new window.

Text:       label the hyperlink.
<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<script runat="server">

    void Page_Load()
        lnkRandom.NavigateUrl = GetRandomFile();

    string GetRandomFile()
        string[] files = Directory.GetFiles(MapPath(Request.ApplicationPath), "*.aspx");
        Random rnd = new Random();
        string rndFile = files[rnd.Next(files.Length)];
        return Path.GetFileName(rndFile);

<html xmlns="" >
<head id="Head1" runat="server">
    <title>Show HyperLink</title>
    <form id="form1" runat="server">

        Text="Random Link"
        Runat="server" />


3.4.1.Using the HyperLink Control
3.4.2.HyperLink: Visible, Text, ToolTip, NavigateUrl