Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > FormDecorator > Hiding ASP Button from code behind

Not answered Hiding ASP Button from code behind

Feed from this thread
  • Posted on May 12, 2010 (permalink)

    Hi,
       I have a requirement to show/hide a button. But when I tried to hide the button from C# code behind page. Still a small rectangle is displayed on the screen. below is the code for that.

     btn_Cancel.Attributes["style"]="visibility:hidden;display:none";

    But it still displays small rectangular box. This is happening when I include FormDecorator in my page. When I looked at the style of that rectangular box using ie developer tool I see a style rfdSkinnedButton. how can I achieve this. I have to use Form decorator in my master page.
    Please help me on this ASAP.

    Thanks in advance.



    Attached files

    Reply

  • Petio Petkov Petio Petkov admin's avatar

    Posted on May 13, 2010 (permalink)

    Hi Pradeep,

    You should  use CssClass to hide the button, and RadFormDecorator will not decorate it, e.g.
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head id="Head1" runat="server">
        <title></title>
      
        <style type="text/css">
            .hiddenClass
            {
                display: none;
                }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
       <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            </Scripts>
        </asp:ScriptManager>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" />
        someText<asp:Button ID="btn_Cancel" Text="btn_Cancel" runat="server" CssClass="hiddenClass" />someText
          
        </form>
    </body>
    </html>



    Kind regards,
    Petio Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > FormDecorator > Hiding ASP Button from code behind
Related resources for "Hiding ASP Button from code behind"

ASP.NET FormDecorator Features  |  Documentation  |  Demos  |  Step-by-step Tutorial  ]