Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Help with HyperLink class

Help with HyperLink class

Scheduled Pinned Locked Moved ASP.NET
questionhelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    David Flores
    wrote on last edited by
    #1

    I just have an quick/easy question. I created a Hyperlink, how do you get rid of the underline under the text? Thanks in advance.

    K L D 3 Replies Last reply
    0
    • D David Flores

      I just have an quick/easy question. I created a Hyperlink, how do you get rid of the underline under the text? Thanks in advance.

      K Offline
      K Offline
      kaschimer
      wrote on last edited by
      #2

      If you are using style sheets, you can create a style that removes the underline ( I believe it is text-decoration: none ) and then apply that to the hyperlink control. Alternatively, you can build the style for each hyperlink control in the design view by clicking the control and then the Style property will let you build a style for that particular one. take this with a grain of sugar, though. It's been a while since I did anything with ASP.NET RabidK

      K 1 Reply Last reply
      0
      • D David Flores

        I just have an quick/easy question. I created a Hyperlink, how do you get rid of the underline under the text? Thanks in advance.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Apply this style to your hyperlink object.

         a {text-decoration:none} </style>
        </code>
        </pre>
        </x-turndown>
        
        1 Reply Last reply
        0
        • K kaschimer

          If you are using style sheets, you can create a style that removes the underline ( I believe it is text-decoration: none ) and then apply that to the hyperlink control. Alternatively, you can build the style for each hyperlink control in the design view by clicking the control and then the Style property will let you build a style for that particular one. take this with a grain of sugar, though. It's been a while since I did anything with ASP.NET RabidK

          K Offline
          K Offline
          kaschimer
          wrote on last edited by
          #4

          In fact, I just looked everything up. You can apply a specific style to the HyperLink control's CssClass property. Additionally, there is a style property that you can build manually for each. And I looked up the css element and I was right, it's text-decoration:none; RabidK

          D 1 Reply Last reply
          0
          • K kaschimer

            In fact, I just looked everything up. You can apply a specific style to the HyperLink control's CssClass property. Additionally, there is a style property that you can build manually for each. And I looked up the css element and I was right, it's text-decoration:none; RabidK

            D Offline
            D Offline
            David Flores
            wrote on last edited by
            #5

            Here is my code HyperLink link = new HyperLink(); //set basic stuff link.Text = this.Title; link.NavigateUrl = this.NavigateUrl; link.ForeColor = Color.FromName(this.ForeColor); link.ToolTip = "Click me!!!"; //this doesnt work link.Style.Add("A","text-decoration:none"); //neither does this link.CssClass = " a {text-decoration:none} "; //add is to the table this.TableTitle.Rows[0].Cells[1].Controls.Add(link); Any ideas?

            1 Reply Last reply
            0
            • D David Flores

              I just have an quick/easy question. I created a Hyperlink, how do you get rid of the underline under the text? Thanks in advance.

              D Offline
              D Offline
              David Flores
              wrote on last edited by
              #6

              The answer is link.Style.Add("text-decoration","none"); thanks to the two guys that helped me out. David

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups