asp.net - How to use internal (application) link in a HyperLink

How to use internal (application) link in HyperLink
HyperLinkInternalLink.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e)
    {
        HyperLink1.NavigateUrl = "~/Picture.aspx";
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to use internal (application) link in HyperLink</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Green">HyperLink Example: Application Link</h2>
        <asp:HyperLink 
             ID="HyperLink1"
             runat="server"
             Text="Flying Fish Page"
             Font-Size="Larger"
             Font-Italic="true"
             Font-Bold="true"
             >
        </asp:HyperLink>
    </div>
    </form>
</body>
</html>
Picture.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e)
    {
        Image1.ImageUrl = "~/Images/FlyingFish.jpg";
        Image1.BorderWidth = 2;
        Image1.BorderColor = System.Drawing.Color.Navy;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>HyperLink control</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Red">Picture Page</h2>
        <asp:Image 
             ID="Image1" 
             runat="server"
             />
    </div>
    </form>
</body>
</html>






More asp.net examples