Error 404 with JSON files in IIS

0

I want to configure the language translation of Datatable by means of local url in a solution of ASP.NET MVC 4.

tblJs = tblHtml.DataTable({
                destroy: true,
                searching: false,
                ajax: { url: '/Area/Control/getDatos'},
                "language": { "url": "~/Scripts/Utilities/datatables/Spanish.json" },
            });

The address of the file is correct, but when consulting it, it shows me this screen.

What configuration do I need to load the json with the translation?

    
asked by Aaron Romero 06.01.2018 в 18:22
source

1 answer

0
  

Because the OP does not understand the theme of the site, he put his solution (answer) to the question. Revisions

Solution:

  

In the web.config file, add the MIME configuration    Reference

<system.webServer>
    <staticContent>
        <mimeMap fileExtension=".json" mimeType="application/json" />
    </staticContent>
  </system.webServer>

Contribution of Asier Villanueva

    
answered by 06.01.2018 в 21:05