How to change the color of disabled link button

{0 Comments}

We always get the same black boring text after the link button gets disabled. Most of time it gets merges in the text too. So after getting disable if you need to change color then you can follow these steps.

  •  Create a css class for your disabled linkbutton mine is below.

 CSS |  copy code |? 
1
<style type="text/css">
2
        .LnkBtn
3
        {
4
            color: #a8a8a8;
5
            text-decoration: none;
6
            cursor: default;
7
        }
8
    </style>

  • Then on click event in code behind add this class, and finally feel the change.

     C# |  copy code |? 
    1
    protected void LinkButton1_Click(object sender, EventArgs e)
    2
        {
    3
            LinkButton1.Enabled = false;
    4
            LinkButton1.CssClass = "LnkBtn";
    5
        }
    6

Leave a Comment

Your email address will not be published.