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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:23:03+00:00 2026-05-24T04:23:03+00:00

I would like to have .html files serve as views alongside other .cshtml views

  • 0

I would like to have .html files serve as views alongside other .cshtml views in my ASP.NET MVC project. The main reason for this is so that the html files are subject to the same custom security rules in my actions that the other views abide by.

I don’t want to use the .cshtml or .aspx extensions because then the framework attempts to compile these rather large files which is waste since the files don’t have anything to compile.

I’ve updated the view engine to look for .html extensions. This works fine, but then the error I’m getting is that I don’t have a registered build provider. I’ve tried registering a build provider for .html files in the web.config, but that doesn’t make any difference in the error.

Is there a build provider that will just pass the text from the .html file straight through without attempting to compile it?

So what I’m looking for is for .html files to live in the views directory so they are only rendered when requested through an action, and the .html views shouldn’t be run through any compilation.

Thanks,

Chris

  • 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-24T04:23:04+00:00Added an answer on May 24, 2026 at 4:23 am

    I found a solution. In my action I return FilePathResult and it just loads the file and passes it through without any compilation.

    return new FilePathResult("path_and_file.html", "text/html");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have directory with > 1000 .html files, and would like to check all
I'm working on an editor page for a project in ASP.NET MVC. I would
I have a html file that has invoice details I would like to know
I have HTML code edited by FCKEditor stored in a database and would like
I have an HTML document where I would like to semantically group text to
I have an HTML page. I would like to extract all elements whose name
I'm building a HTML template for my site and would like to have a
I would like to put a placeholder into e.g. the footer.html and have it
I have the following HTML: <div id=mydiv> </div> I would like to load content
I have the following html code: <h3 id=headerid><span onclick=expandCollapse('headerid')>&uArr;</span>Header title</h3> I would like to

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.