Hiding RadMenu item client side

2 posts, 0 answers
  1. Ron
    Ron avatar
    17 posts
    Member since:
    Jul 2011

    Posted 18 Sep 2012 Link to this post

    I am trying to hide a menu item from the client, but after the menu is hidden it reappears.
    What am I doing wrong?

    Here's the sample code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        <script type="text/javascript">
          function ClientClicked(sender, args) {
            var menu = $find("<%= treeMenu.ClientID %>");
            var items = menu.get_items();
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Simple">
    <telerik:RadMenu Runat="server" ID="treeMenu">
        <telerik:RadMenuItem runat="server" Text="Root RadMenuItem1">
        <telerik:RadMenuItem runat="server" Text="Root RadMenuItem2">
        <telerik:RadMenuItem runat="server" Text="Root RadMenuItem3">
        </telerik:RadMenu><br />
        </telerik:RadMenu><br />
        <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton" 
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Sep 2012 Link to this post

    Hi Ron,

    I also observed the same behavior. Try setting AutoPostBack as false for the RadButton.
    <telerik:RadButton ID="RadButton1" AutoPostBack="false" runat="server" Text="RadButton"  OnClientClicked="ClientClicked"></telerik:RadButton>

Back to Top