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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:49:47+00:00 2026-05-12T05:49:47+00:00

I would like to route incoming requests for different resources, some returning files such

  • 0

I would like to route incoming requests for different resources, some returning files such as css, others returning responses generated by the server, and others being redirected to aspx pages for AJAX functionality.

The current configuration uses an HttpModule to remap all requests to one handler, where urls are parsed and dispatched, as an entry point to the server.

I am wondering what the best configuration to handle requests would be, should I remap from the HttpModule to a HandlerFactory, where I parse the url, and route to an appropriate handler based on that url, or should I attempt to set it up all in the web.config?

Also How can I route requests to an aspx page from a HttpHandler and HttpHandlerFactory?

  • 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-12T05:49:47+00:00Added an answer on May 12, 2026 at 5:49 am

    If the rules for routing requests to various handlers is very simple (e.g. “.ext goes to handler xyz”) you should definitely use the built-in .NET mechanism with web.config – there’s no reason to reinvent the wheel here. If the logic is possibly more complex or deals with more than just extension mappings, a module is appropriate.

    Secondly, you should use an HttpHandlerFactory, because a factory can return IHttpHandlers, and an ASPX page is an IHttpHandler. So if you use your custom factory, if your logic determines it should “route” to an ASPX page, you can return an instance of the page directly from the Factory:

    IHttpHandler thePage = PageParser.GetCompiledPageInstance(
        requestPath,
        pathToAspxFile,
        httpContext);
    
    return thePage;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my routing I would like to have something like not found route handler.
I would like to use create a rails route for a user's open id.
I would like to set up a route for a controller that has the
I use log4j and would like to route the output of certain Loggers to
I have a route like following, ideally I would like it to match: domain.com/layout/1-slug-is-the-name-of-the-page
In my Rails application, I would like to route /product/productname1, /product/productname2, etc. to ProductController::index().
I would like to find a way to have as response the real route,
Would like to get a list of advantages and disadvantages of using Stored Procedures.
Would like to create a strong password in C++. Any suggestions? I assume it
I would like to test a string containing a path to a file for

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.