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

  • Home
  • SEARCH
  • 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 476983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:32:42+00:00 2026-05-13T00:32:42+00:00

I am struggling with MVC – which I love – and it’s features. I

  • 0

I am struggling with MVC – which I love – and it’s features.
I am trying to load a menu in the Application_Start event.
I want to load some links with the correct url (controllerName/actionName) but I can’t use the Url.Action or other methods to build the path.

Can anybody help me?

  • 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-13T00:32:43+00:00Added an answer on May 13, 2026 at 12:32 am

    Why would you want to build your menu in the application_start? Is it for some kind of caching? Anyway here goes..

    RegisterRoutes(RouteTable.Routes);
    var httpContext = new HttpContextWrapper(HttpContext.Current);
    UrlHelper urlHelper = new UrlHelper( new RequestContext(httpContext, new RouteData()));
    var urlToHome = urlHelper.RouteUrl("Home");
    

    I would rather recommend doing a RenderAction on your masterpage what points to a action that is cached, or something like that.

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

Sidebar

Related Questions

I just started ASP.NET MVC (coming from WebForms) and I'm struggling with some really
I'm trying to make some changes in an Visual Studio 2008 MVC 1 code,
I'm struggling to figure out the correct way to do something in MVC which
I am struggling to find good content of MVC and TDD. I just want
Hi guys I've struggling how to get the event blur from a asp.net mvc
I am using mvc webapi to create a REST API and struggling to find
Obviously MVC promotes separation of concerns. One thing we are struggling with is proper
I'm struggling with the proper organisation of a (MVC) Controller for my validation of
Lately, I'v been struggling with an annoying situation on ASP.NET MVC. Here's the story
struggling a bit to get the following to work : I'm trying to merge

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.