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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:32:54+00:00 2026-05-26T02:32:54+00:00

Is it possible that static files not be processed by the asp.net mvc engine?

  • 0

Is it possible that static files not be processed by the asp.net mvc engine?

Can I do this at the IIS level or something? (without ofcourse creating a seperate IIS website for static files)

  • 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-26T02:32:54+00:00Added an answer on May 26, 2026 at 2:32 am

    You need to create an ignore route for the specific types of files you don’t want to be served through ASP.NET MVC.

    Add the following to your routes, for the types of files you want to ignore.

    The following works for files in the root:

    routes.IgnoreRoute("{file}.css");
    routes.IgnoreRoute("{file}.jpg");
    routes.IgnoreRoute("{file}.gif");
    

    If you want to ignore files in a specific directory, you can do this:

    routes.IgnoreRoute("assets/{*pathInfo}");
    

    If you want to combine these into one route, you can (e.g., ignore specific types of files in a directory):

    routes.IgnoreRoute("{assets}", new { assets = @".*\.(css|js|gif|jpg)(/.)?" });
    

    This overload of IgnoreRoute accepts a url (the first argument) and a Constraints object of things to ignore.

    Since the RouteConstraints in ASP.NET MVC can be implemented multiple ways (including a regex), you can put standard regexes in the second argument.

    If you want to implement a custom constraint, there is lots of useful documentation on that subject (say, if your constraint is dynamic at runtime).

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

Sidebar

Related Questions

changing a static resource during runtine is something that sounds not possible. I have
Possible Duplicate: Database Deployment issues I followed the steps in this video: http://www.asp.net/iis/videos/developing-and-deploying-in-a-shared-hosting I
How is it possible that .NET is finding the wrong MyType in this scenario?
Is it possible that I reserve a asp.net code in db and load it
It is quite possible that I may not have got the point, but I
is it possible that my mingw 3.4.5 installation is faulty? or is this provided
It's possible that I'm not really understanding how git works here, but I have
I'm not experienced with java applications but I found out that finding static pointers
I'm developing an asp.net webservice application to provide json-formatted data to a widget that
From what I understood, it is not possible to read files using Greasemonkey. I

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.