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

The Archive Base Latest Questions

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

In a web application I’m working on, we’d like to be able to show

  • 0

In a web application I’m working on, we’d like to be able to show information about resources at a given path. The path is entirely virtual—it only exists in the application—so we don’t really have a problem with users setting virtual paths that are “weird” by normal file system standards.

The issue: we have a route that reads something similar to

/Files/{*path}

and we attempt to redirect with

Url.RouteUrl("File", new { path = somePath })

This usually works, but fails if somePath contains & or #, among others. In those cases, I’m suck. I can’t UrlEncode(somePath) at this point, because RouteUrl does its own URL encoding, but I can’t leave them as-is, because otherwise they’re treated improperly (the octothorp doesn’t get passed to the routing data, and the ampersand confuses IIS). Is there a sane way around this? Or do I basically just need to implement my own routes via string interpolation?

  • 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-12T17:49:11+00:00Added an answer on May 12, 2026 at 5:49 pm

    The best answer I’ve found so far, though it only works on IIS7, is to follow the instructions at http://dirk.net/2008/06/09/ampersand-the-request-url-in-iis7/ to edit the registry and change some of IIS7’s default behavior. This is unacceptable for us, since we’re making an application that will be installed on end user’s machines—and at any rate, even if we weren’t, there’d be the simple fact that IIS6 and IIS5 don’t respond to this sequence. Any ideas for earlier versions of IIS, or ways to override this behavior programmatically in IIS7, would be wonderful.

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

Sidebar

Related Questions

The web application I'm working on serves up images with URLs like /image?name=a.gif. Pages
In web application, i am using regular expression for date like dd-mm-yyyy format for
The web application im working on has a few custom attributes on HTML elements
My web application contains a text box for which I would like to restrict
My web application retrieves the location of an image from database. I'd like to
Our Web-Application uses Application cache (cache manifest) to restore HTML page and resources in
Our web application uses Windows Integrated Authentication (aka NTLM Auth) for security. It's working
My web application is sending transactional emails to its users (like You received a
This web application is about posting different kind of posts to the web application
If web application and SQL Server are on different machines(both running Windows) on intranet,

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.