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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:41:50+00:00 2026-06-11T07:41:50+00:00

I have an MVC4 app, but I’m primarily using it for the WebAPI parts.

  • 0

I have an MVC4 app, but I’m primarily using it for the WebAPI parts. I want to have a “plain old HTML” file sent back to the user (which will then use KnockoutJS or KendoUI to pull JSON from the webapi controllers).

I know I can do this:

routes.IgnoreRoute("{page}.html");

And then if I browse to “localhost/index.html” it does successfully just return my .html page.
However, I really want to map the “root” default path “localhost/” to return my index.html.

I tried this:

routes.MapPageRoute("root", "", "~/index.html");

but that throws the error:

There is no build provider registered for the extension ‘.html’. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value ‘Web’ or ‘All’.

Anyone have any ideas on how I can make this work? I could just hit a default controller that returns a plain html page, but it seems like overkill to go through the entire ASP.NET stack once for the HTML page, which then just calls a WebAPI URL to go back through the ASP.NET stack to get some JSON data for the page’s model.

I basically just want to “skip” all the MVC plumbing and have IIS send me back the html page, as if it wasn’t an ASP.NET app, or at least do as little processing as possible.

  • 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-06-11T07:41:52+00:00Added an answer on June 11, 2026 at 7:41 am

    Add the following to your routing config:

    routes.IgnoreRoute("");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a method using the new WebAPI features in MVC4 and have it
I've got really used to developing views in MVC4 using Razor. But I have
I have a custom ViewEngine that I am using with my MVC4 web app.
I have an ASP.NET MVC4 app which uses DotNetOpenAuth 4.0.1 to authenticate users with
I have a web site built using ASP.NET MVC4 that I can publish fine
I have a MVC4 webapi controller. It has no parameter-less constructors. So, i use
I have a web app built with MVC 4 with WebApi on the back
I have installed MVC4 and an MVC3 app that I have is now causing
I have an asp.net MVC4 application that I am using Unity as my IoC.
Have just started using Google Chrome , and noticed in parts of our site,

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.