Filling Text of RadMenuItem in Code Behind.

2 posts, 0 answers
  1. Tonino
    Tonino avatar
    107 posts
    Member since:
    Nov 2007

    Posted 14 Jun 2013 Link to this post


    I have a 'classic' RadMenu with different items. My goal is to read the text of the menu items from a funtion in code behind. Reading from resx works (first item). The other menu items don't show any text.

             <radM:RadMenu ID="phMenu" runat="server" IsContext="True" ContextMenuElementID="none"
                   <radM:RadMenuItem runat="server" Text="<%$Resources:InputControlsRes,menuAddFiltername_Text %>" Value="AddFiltername" />
                   <radM:RadMenuItem runat="server" Text='<%# GetStringResource("ActionId") %>' Value="AddActionId" />
                   <radM:RadMenuItem runat="server" Text='<%# GetStringResourceActionId %>' Value="AddActionIdFix" />
                   <radM:RadMenuItem runat="server" Text='<%= GetStringResourceActionIdPro100 %>' Value="AddActionIdFixPro100" />

    Code Behind:
       Protected Function GetStringResource(key As String) As String
          Return key
       End Function

       Protected Function GetStringResourceActionId() As String
          Return "ActionId"
       End Function

       Protected Function GetStringResourceActionIdPro100() As String
          Return "GetStringResourceActionIdPro100"
       End Function

    Functions in code behind are never called, even if I do a DataBind.

  2. Kate
    Kate avatar
    1898 posts

    Posted 17 Jun 2013 Link to this post

    Hi Tonino,

    Unfortunately we no longer provide support for the classic menu control as fully described in this post. I would however, suggest that you upgrade to the latest version of the Telerik controls and refer to this help article where you can find detailed information on the scenario that you are trying to achieve.

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top