7

I'm trying to use (handlebar) .hbs template in ASP.net MVC5 project, but I can not load the .hbs file.

it occurs HTTP Error 404.3 - Not Found

I load like this,

define [
    'hbs!./index'
],

and I confirmed the path is fine. (http://local_host:1460/Scripts/js/apps/index/index.hbs)

Do I need to set about .hbs extension in somewhere?

Anybody know, please advice me.

1 Answer 1

13

Yes, you need to tell IIS Express how to handle .hbs. Just add the following to your project's web.config:

<system.webServer>
  ...
  <staticContent>
    <mimeMap fileExtension=".hbs" mimeType="text/x-handlebars-template" />
  </staticContent>
</system.webServer>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.