[CLOSED] underline LinkButton

  1. #1

    [CLOSED] underline LinkButton

    How can I do to underline that the LinkButton only appear when mousing.
    I want the LinkButton to appear on the screen without the underline, and passing the mouse over the LinkButton it is underlined.

    Thanks.
    Last edited by Daniil; Mar 03, 2011 at 2:49 PM. Reason: [CLOSED]
  2. #2
    Hi,

    You easily can achieve this requirement (and similar ones) using css rules/classes.

    Please look at the example.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    
        <style type="text/css">
            .my-class a {
                text-decoration: none;
            }
            
            .my-over-class {
                text-decoration: underline;    
            }
        </style>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:LinkButton 
                runat="server" 
                Text="Link" 
                Cls="my-class" 
                OverCls="my-over-class" />
        </form>
    </body>
    </html>
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    You easily can achieve this requirement (and similar ones) using css rules/classes.

    Please look at the example.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    
        <style type="text/css">
            .my-class a {
                text-decoration: none;
            }
            
            .my-over-class {
                text-decoration: underline;    
            }
        </style>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:LinkButton 
                runat="server" 
                Text="Link" 
                Cls="my-class" 
                OverCls="my-over-class" />
        </form>
    </body>
    </html>
    Ok, ran the underline, but when you hover it nonetheless underlined
  4. #4
    Please replace
    .my-over-class {
        text-decoration: underline;    
    }
    with
    .my-over-class a { 
        text-decoration: underline;    
     }
    Also you could avoid using OverCls and do everything using css (it's better).

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
        <style type="text/css">
            .my-class a {
                text-decoration: none;
            }
            .my-class a:hover {
                text-decoration: underline;
            }
        </style>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:LinkButton runat="server" Text="Link" Cls="my-class" />
        </form>
    </body>
    </html>
  5. #5
    Quote Originally Posted by Daniil View Post
    Please replace
    .my-over-class {
        text-decoration: underline;    
    }
    with
    .my-over-class a { 
        text-decoration: underline;    
     }
    Also you could avoid using OverCls and do everything using css (it's better).

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
        <style type="text/css">
            .my-class a {
                text-decoration: none;
            }
            .my-class a:hover {
                text-decoration: underline;
            }
        </style>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:LinkButton runat="server" Text="Link" Cls="my-class" />
        </form>
    </body>
    </html>

    Ok, thanks, worked perfectly

Similar Threads

  1. [CLOSED] LoginView with LinkButton
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 04, 2012, 11:16 AM
  2. [CLOSED] textfield red underline validation not working
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 13
    Last Post: Feb 16, 2012, 1:42 PM
  3. Replies: 2
    Last Post: Apr 28, 2011, 1:34 PM
  4. LinkButton Style
    By HzA in forum 1.x Help
    Replies: 0
    Last Post: Feb 08, 2011, 9:53 AM
  5. [CLOSED] How to add underline to button with keyboard shortcut?
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 11, 2009, 11:29 PM

Tags for this Thread

Posting Permissions