Change color of button

2 posts, 1 answers
  1. Alan
    Alan avatar
    10 posts
    Member since:
    May 2012

    Posted 07 Jun 2012 Link to this post

    How can I disable and change the color of a radbutton after click.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Jun 2012 Link to this post

    Hi Alan,

    Here is the sample code which I tried based on your scenario.

    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" AutoPostBack="true" onclick="RadButton1_Click" DisabledButtonCssClass="colored" CssClass="notdisabled" >
    </telerik:RadButton>
    JS:
    function OnClientClicked(sender, args)
    {
       sender.set_enabled(false);
    }
    CSS:
    <style type="text/css">
    .colored
     {
       background-color:Red !important;
     }  
      .RadButton_Default.rbSkinnedButton, .RadButton_Default .rbDecorated, .RadButton_Default.rbVerticalButton, .RadButton_Default.rbVerticalButton .rbDecorated, .RadButton_Default .rbSplitRight, .RadButton_Default .rbSplitLeft
      {
       background-image:none !important;
       }
       .notdisabled
         {
            border:1px solid black !important;
         }
       </style>


    Hope this helps.
    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top