Help with HyperLink class
-
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.
-
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.
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
-
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.
-
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
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
-
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
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?
-
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.
The answer is link.Style.Add("text-decoration","none"); thanks to the two guys that helped me out. David