ImageUrl Property of Hyperlink Control example

September 28, 2013 0 Comments

Example of ImageUrl Property

If you want to use image in place of Text on hyperlink control then you must specify the ImageUrl Property to the Hyperlink control. If you have been set ImageUrl then your Text will be hide because Image priority is high compare to text.

Lets take an example 


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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="~/submit.jpg"
            NavigateUrl="Http://www.google.com">HyperLink</asp:HyperLink>
    </div>
    </form>
</body>
</html>


Output
ImageUrl Property of Hyperlink Control example

Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google

0 comments: