Error 404 using asp.net web api -


i've got 2 projects: core , web.

core project has api controllers, models, etc. web project has html pages only.

i'm loading data api using jquery. when core project (created view), ok. when web project, i've got error 404, fiddler shows ok.

why so? what's problem?

i found answer. because it's cross domain application. , it's necessary implement cors support. can done 2 ways.

first. add section of web.config file next:

<httpprotocol>  <customheaders>   <add name="access-control-allow-origin" value="*" />   <add name="access-control-allow-headers" value="content-type" />   <add name="access-control-allow-methods" value="get, post, put, delete, options" />  </customheaders> </httpprotocol> 

second. create custom messagehandler. in this post


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -