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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:51:02+00:00 2026-06-02T04:51:02+00:00

I have a request and it has a route but there are loads of

  • 0

I have a request and it has a route but there are loads of them as set up in the global.asax…one typical route is…

routes.MapRoute(
                "NewStore",
                "{culture}/{client}/{brand}/NewStore/{action}",
                new
                {
                    culture = UrlParameter.Optional,
                    client = UrlParameter.Optional,
                    brand = UrlParameter.Optional,
                    controller = "NewStore",
                    action = "Index"
                }
                );

I need to create a ddl that switches the culture on the page. So actually all I want to do is recreate the route url but change one argument. So I want to do something lhe this…

    Route currentRoute = httpContext.GetCurrentRoute();
    Route englishCultureRoute = currentRoute;
    Route spanishRoute = currentRoute;
    englishCultureRoute.RouteData.Values["culture"] = "en-en"
    spanishRoute RouteData.Values["culture"] = "es-es"

@Html.SelectListForRoutes(englishCultureRoute,spanishRoute);

So the above is pseudocode, I want to do the first bit in a controller but how do I do this in c#?

  • 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-02T04:51:06+00:00Added an answer on June 2, 2026 at 4:51 am

    you can access the route data from the controller from

    RouteData
    

    if you want to assign new values you can do something like this

    public ActionResult Index(int id)
    {
        RouteData.Values["id"] = 555;
        return View();
    }
    

    and in the view you can access the route data values from

    @ViewContext.RouteData.Values["Id"]
    

    but if your taking about globalizing your app there are better solutions , you can check this

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

Sidebar

Related Questions

I have this route that worked before we upgraded our application to MVC3: routes.MapRoute(
I have 100 web servers and noticed that some of them have request filtering
I have a request in from a client that would like one of their
I have an asp.net mvc app with a route that allows users to request
I have a route routes.MapPageRoute(clientOrder, Contract/{contractId}/Orders, ~/ContractOrders.aspx); The idea is to authorize user to
I have a similar question as Ruby on Rails. Unicode routes but the answer
Is there any reason why a route would be properly mapped in one environment
I have no custom routes in my application, only the default one. If i
I have request where i need to change grid formatting on drop down action
I have a request handler running in apache/mod_php which occasionally expands beyond the maximum

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.