Click here to Skip to main content
12,063,909 members (60,462 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
I would like to know how to remove the underline of a hyperlink text. Hereunder is my code:

<asp:HyperLink ID="HyperLink1" NavigateUrl="~/registration.aspx" runat="server"
        style="z-index: 1; top: 173px; position: absolute; height: 26px; width: 110px; left: 1081px;">New registration</asp:HyperLink>

Beneath 'New registration' the underline that appears on the screen has to be removed.
Can any one advice.

Regards.
Posted 13-Jan-13 18:05pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Handle it in your style sheet. Add the following

#HyperLink1
{
  text-decoration: none;
}

This will remove the underline from your hyper link for this specific ID
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Add CssClass property to hyperlink

<asp:HyperLink ID="HyperLink1" NavigateUrl="~/registration.aspx" runat="server" CssClass="hyp">New registration</asp:HyperLink>

<style type="text/css">
 
        .hyp
        {
            text-decoration:none;
            z-index: 1;
            top: 173px; 
            position: absolute;
            height: 26px;
            width: 110px;
            left: 1081px;
        }
    </style>
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You can add this in the <asp:HyperLink> too, something like this:

<asp:HyperLink ID="HyperLink1" runat="server" Font-Underline="false" />
Hope it helps.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web03 | 2.8.160204.4 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100