Arcgis Javascript Api for MVC

01-29-2019 05:28 AM
New Contributor

Good day everyone. I recently started a project on MVC 5 and I am trying to use the javascript API from Arcgis. I used the API before in webforms in .aspx pages and just normal html and it worked as expected. I am now trying to use the same API in Razor views as i require other information to be posted from my Controllers. The question is i tried using the javascript references

and the same code from the samples they provide for javascript but require() in the cshtml page return undefined, but on webpages (.aspx/.html) it returns the desired results. I just want to know am i missing something or is the javascript api not compatible with MVC razor pages.

This is the sample code attached as it works in html and aspx. But returning undefined in cshtml.

0 Kudos
0 Replies