Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8072811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:08:54+00:00 2026-06-05T14:08:54+00:00

I have an ASP Menu like this: <asp:Menu ID=NavigationMenu runat=server EnableViewState=False IncludeStyleBlock=False Orientation=Horizontal meta:resourcekey=NavigationMenuResource1>

  • 0

I have an ASP Menu like this:

<asp:Menu ID="NavigationMenu" runat="server" 
 EnableViewState="False" IncludeStyleBlock="False"
 Orientation="Horizontal" meta:resourcekey="NavigationMenuResource1">
       <Items>
             <asp:MenuItem NavigateUrl="~/Default.aspx" Text="<% MenuItemResource1 %>" meta:resourcekey="MenuItemResource1"/>
             <asp:MenuItem NavigateUrl="~/Products.aspx" Text="Products" meta:resourcekey="MenuItemResource2" />
       </Items>
</asp:Menu>

What I want to do, is to change the MenuItem text based on the user language selection (CultureInfo). For example, the “Products” section should be called “Produits” in french.

I added a .resx file for english and french. If I use a < div> element with an Id, this works fine. The problem is that the asp MenuItem doesn’t seem to have an ID, so I’m not able to access it. Like the example, I tried to set the first MenuItem text with to a “Resource” item, but when I change the language, the text is not changing.

How can I change that text?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:08:56+00:00Added an answer on June 5, 2026 at 2:08 pm
        System.Reflection.FieldInfo[] fi = 
        this.GetType().GetFields(BindingFlags.Public | 
        BindingFlags.Instance | BindingFlags.NonPublic);
    
    for (int i = 0; i < fi.Length; ++i)
    {
        FieldInfo info = fi[i];
    
        //info can be Button, Menuitem, ToolbarButton.....
        //info.Name returns true name of control
        //        - menuItem1, btnChangelanguage....
        if (typeof(MenuItem) == info.FieldType)
        {
            MenuItem item = (MenuItem)info.GetValue(this);
            item.Text = resources.GetString(info.Name + ".Text");
        }
    }
    

    http://www.codeproject.com/Articles/14615/Dynamically-changing-menu-items-according-to-Cultu

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a master page with a bunch of menu like: <ul id=ulMenu runat=server>
I have a menu user control with image buttons like this one: <asp:TableCell ID=tcDownload
I have asp.net Menu Item <asp:MenuItem NavigateUrl= Text=Download Value=Download/> . When this item gets
my master page is inside a form runat=server like this: <body> <form id=Form1 runat=server>
I have following aspx page called search.aspx: <div id=wrap> <div id=menu> <div id=t_menus runat=server>
I'm using a ASP.NET menu control. I'd like the menu to look like this,
I have a master page that contains an ASP.NET server side Menu control (System.Web.UI.WebControls.Menu)
I have this asp:menu with a few items and want to be able to
Ok I have an asp.net menu control which is created from codebehind. It works
I have asp.net mvc 4 web application project on my server in IIS Directory.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.