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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:11:29+00:00 2026-05-26T01:11:29+00:00

In my MVC2 application I have an AccountController class inherited from Controller . I

  • 0

In my MVC2 application I have an AccountController class inherited from Controller. I want to achieve the following: when a user tries to open Account/Payments/NewPayment AccountController.ExecuteNewPayment() method should be invoked.

I added the following route:

routes.MapRoute(
    @"CreateNewRuntime",
    @"{langId}/Account/Payments/NewPayment/{whatever}",
    new { langId = @"default", controller = @"Account", action = @"ExecuteNewPayment"});

but when I try to request the path above I get HTTP 404 error message with “Requested URL” /Account/Payments/NewPayment and when I do that under debugger there’s an exception

A first chance exception of type ‘System.Web.HttpException’ occurred in System.Web.Mvc.dll
Additional information: The controller for path ‘/Account/Payments/NewPayment’ was not found or does not implement IController.

What am I doing wrong? How do I perform the mapping?

  • 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-26T01:11:30+00:00Added an answer on May 26, 2026 at 1:11 am

    You need to include the langid as part of your route or MVC will not map your URI to it even if you have a default specified.

    Take these two routes:

    routes.MapRoute(
        @"CreateNewRuntime",
        @"{langId}/Account/Payments/NewPayment/{whatever}",
        new { langId = @"default", controller = @"Account", action = @"ExecuteNewPayment"});
    
    
    routes.MapRoute(
        @"CreateNewRuntime1",
        @"{langId}/{subLangId}/Account/Payments/NewPayment/{whatever}",
        new { langId = @"default", subLangId= @"test", controller = @"Account", action = @"ExecuteNewPayment1"});
    

    If I specify the URI of /Account/Payments/NewPayment, which one of the routes should it pick? If MVC did use the default for langId then the first route would always get used since it was declared before the other one. If you swapped the two then the second one would always get invoked.

    When you have varying data in the beginning of your URI’s you need to specify them and you cannot use the default value when specifying the route. In order for these two routes to be hit you would need a URI of /eng/Account/Payments/NewPayment and /eng/e/Account/Payments/NewPayment

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

Sidebar

Related Questions

I am developing an ASP.NET MVC2 application in which I have a User class
I have an asp.net MVC2 application that needs to call a web service from
I have an ASP.NET MVC2 application that uses a parent controller to setup specific
I have an MVC2 application with the following classes: -OrderModel -LineOrderModel -OrderController -LineOrderController In
I have asp.net MVC2 application. I am using VS2008 and want to hook up
In my ASP.NET MVC2 application, I have a ViewModel class called UserCreateViewModel. In this
Hi i have mvc2 application where i want to stop processing application when settings
I have an MVC2 application and I need to add code from another application
I have an entity relationship setup in my mvc2 application such that each user
strange 1 here.. have a solution with multiple projects in (mvc2 application, class library

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.