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 4084110
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:23:53+00:00 2026-05-20T18:23:53+00:00

the problem i encounted concerns redirecting in the navigation menu. I’d like to dynamicly

  • 0

the problem i encounted concerns redirecting in the navigation menu. I’d like to dynamicly create a navmenu. Depending on what role the user has we get to see the required navigation menu items.
At the moment i use:

if (found)
            {
                if (admin == true)
                {
                    NavigationMenu.Items.Add(new MenuItem("Agenda", "/AdminPages/Agenda.aspx"));
                    NavigationMenu.Items.Add(new MenuItem("Add Product", "/AdminPages/ProductToevoegen.aspx"));
                }
                else if (user == true)
                {}

This code I have placed in my Site.master.cs, but I also have a control in my login.aspx.cs code which does a Response.Redirect("~/AdminPages/Agenda.aspx"); to a certain page depending on admin or user once logged in. Now the problem I have is that when I log in, a part works, so it controls the role and adds the required navigation menu items. But when I click for example on the Add Product link it doesn’t redirect me to the page. It keeps redirecting me to :

http://localhost:52853/AdminPages/Agenda.aspx

In the url bar it actually shows the url followed with a # when clicked and than redirect to the Agenda page.

Any ideas on how to fix this problem? I tried finding a way to put the navigation links in the login.aspx.cs code aswell but couldn’t find the correct way to refer to the NavigationMenu, don’t know if that could be off any help. Thank you in advance.

  • 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-05-20T18:23:53+00:00Added an answer on May 20, 2026 at 6:23 pm

    Hm might not be the correct way but i fixed it making another menu in the site.master.aspx file called MenuAdmin for example. Than in the code behind i’ve set the

    NavigationMenu.visible = false;
    

    and

    MenuAdmin.visible = true;
    

    Seems to work fine, does what it needs to do for now 😉

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

Sidebar

Related Questions

Uhm I'm not sure if anyone has encountered this problem a brief description is
We encountered a problem with using Subversion on Windows. A developer committed a file
I encountered a problem when running some old code that was handed down to
I recently encountered a problem where a value was null if accessed with Request.Form
I've encountered a problem when retrieving a JSONP response from a server in a
A problem I've encountered a few time in my career is in a tiered
I've encountered a problem with my Netbeans 6.1 IDE. After an unsuccessful update, Netbeans
I have encountered a problem that I have not come accross yet when setting
On Windows I have a problem I never encountered on Unix. That is how
I'm migrating a TSQL stored procedure to PL/SQL and have encountered a problem -

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.