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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:16:37+00:00 2026-05-23T15:16:37+00:00

I want to create a route that redirects all requests matching certain pattern to

  • 0

I want to create a route that redirects all requests matching certain pattern to a location built using parts of the pattern. I want to grab some segment in the URL and treat the rest like a path to an aspx page in Web Forms application. For example

RouteTable.Routes.MapPageRoute("SomeRouteName", "{something}/{*path}", "~/pages/{*path}/Default.aspx");

Where *path could be something contain “\”. The query string should be preserved as a query string.

Is it possible to create souch a route?

  • 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-23T15:16:37+00:00Added an answer on May 23, 2026 at 3:16 pm

    After looking at several ways to do this I ended up creating my own routing handler that is something like this:

    public class SomethingRoutingHandler : IRouteHandler
    {
        public IHttpHandler GetHttpHandler(RequestContext requestContext)
        {
            string something = (string)requestContext.RouteData.Values["something"];
            string path = (string)requestContext.RouteData.Values["path"];
    
            string virtualPath = "~/" + path + "Default.aspx";
    
            return BuildManager.CreateInstanceFromVirtualPath(virtualPath, typeof(Page)) as Page;
        }
    }
    

    I then use the RouteData in the pages to access something. I found these articles helpful:

    http://msdn.microsoft.com/en-us/magazine/dd347546.aspx

    http://www.xdevsoftware.com/blog/post/Default-Route-in-ASPNET-4-URL-Routing.aspx

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

Sidebar

Related Questions

This is the default route that is given when you create a project -
I want to create wayfinder/pathfinder mobile application. it will route visitors in our buildings.
I wanted to do a POST request to the 'create' route, generated through scaffolding.
I tried some work using http handler and found that we can not execute
Helo... i'm new in cakephp, i want to create 2 login form, 1 for
I want to implement a tracking pixel for inside an email. The tracking pixel
I have a has_many through association between videos and topics, with topicable being the
Please excuse the simplicity and length of this, but I have a little test
I've created a file in the tmp directory with the following controller code: def
I thought maybe there is MySQL command to pull up the last X records

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.