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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:21:55+00:00 2026-05-31T05:21:55+00:00

Sometimes my application generates URLs that look like http://localhost/?Area= or http://localhost/SomeController?Area= I don’t currently

  • 0

Sometimes my application generates URLs that look like http://localhost/?Area= or http://localhost/SomeController?Area=

I don’t currently have any areas defined in this project, and I have tried removing area registration from application startup.

The only answer I have found is to use <a href="Url.Action()"> URLs.

There must be a cleaner way of removing this. Manually removing this from the URLs seems to provide the exact same result, but I am unsure as to why this is coming up in the the first place.

How do I resolve this using the routing system?
please note that i am using t4mvc to generate actionlinks not the default
mvc actionlink helpers

Edit:

public class MvcApplication : System.Web.HttpApplication
{
    public static void RegisterGlobalFilters(GlobalFilterCollection filters)
    {
        filters.Add(new HandleErrorAttribute());
    }



    /// <summary>
    /// Registers MVC Routing Collection.
    /// </summary>
    /// <param name="routes">The routes.</param>
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");




        routes.MapRoute(
            "secstdsrte",
            "SecondaryStandards/{standardType}/{sampleid}",
            MVC.Reports.SecondaryStandards(),
            null,
            new { standardType = new SecondaryStandardTypeConstraint()

            }
        );


        routes.MapRoute(
            "misaRoute",
            "Misa",
            MVC.Reports.MISA()
            );

        routes.MapRoute(
            "outfallroute",
            "Outfalls/{fromDate}/{toDate}",
            MVC.Reports.Outfalls( ApplicationController.DefaultFromDate, ApplicationController.DefaultToDate),
            null,
            new 
            { 
                fromDate = new DateTimeConstraint(), 
                toDate = new DateTimeConstraint()
            }
        );

        routes.MapRoute(
            "offspecRoute",
            "Offspec/{fromDate}/{toDate}",
            MVC.Reports.OleOffspec(ApplicationController.DefaultFromDate, ApplicationController.DefaultToDate),
            null,
            new //route constraints 
            {
                fromDate = new DateTimeConstraint(),
                toDate = new DateTimeConstraint()
            }
        );

        routes.MapRoute(
            "searchRoute",
            "Search",
            MVC.Reports.Search()

        );





        routes.MapRoute(
        "compareresultsroute",
        "compare/{samplePoint}/{analysis}/{fromDate}/{toDate}",
        MVC.Reports.CompareResults(null, null, null, ApplicationController.DefaultFromDate, ApplicationController.DefaultToDate),
        null,
        new
        {
            samplePoint = new SamplePointExistsConstraint(),
            analysis = new AnalysisExistsConstraint(),
            fromDate = new DateTimeConstraint(),
            toDate = new DateTimeConstraint() 
        }

        );

        routes.MapRoute(
        "reportsRoute",
        "Reports/{samplePoint}/{fromDate}/{toDate}",
        MVC.Reports.Results("", ApplicationController.DefaultFromDate, ApplicationController.DefaultToDate),
        null,
        new //route constraints 
        {
            samplePoint = new SamplePointExistsConstraint(),
            fromDate = new DateTimeConstraint(),
            toDate = new DateTimeConstraint() }
        );

        routes.MapRoute(
            "railcarsRoute",
            "RailCars/{forDate}",
            MVC.Reports.RailCars(ApplicationController.DefaultToDate),
            null,
            new { forDate = new DateTimeConstraint() }
        );

        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new
            { controller = "Reports", action = "Index", id =UrlParameter.Optional } // Parameter defaults
        );
    }
    /// <summary>
    /// Returns boolean value indicating whether the application is currently in debug mode 
    /// </summary>
    public static bool isDebugging
    {
        get
        {
            return HttpContext.Current != null && HttpContext.Current.IsDebuggingEnabled;
        }
    }




    protected void Application_Start()
    {

        AreaRegistration.RegisterAllAreas();

        RegisterGlobalFilters(GlobalFilters.Filters);
        RegisterRoutes(RouteTable.Routes);
    }
}
  • 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-31T05:21:56+00:00Added an answer on May 31, 2026 at 5:21 am

    This issue was previously discussed on T4MVC @Url.Action(MVC.Controller.Action()) Renders "?Area=" Parameter in QueryString.

    In short, it’s a bug in T4MVC when the site doesn’t use areas. You can work around by deleting this line (around line 303):

    result.RouteValueDictionary.Add("Area", area ?? "");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an application that generates data for reports that look like: age <
I have a user of my application that sometimes when they run the application
I have a web application that stores a lot of user generated files. Currently
I have a console application written in Free Pascal, that like most larger applications
We have an application that generates pdf files, some times for some unknown reason,
In our application we sometimes have to make minor GUI modifications for different customers:
In my database application I sometimes have to deal with null strings in the
I'm working on a WPF application that sometimes exhibits odd problems and appears to
We are running a Java application that sometimes freezes because some thread is using
We have an ASP.NET application that uses Forms Auth. When users log in, a

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.