The value of the property 'require' is null

1173
2
Jump to solution
03-07-2017 12:45 PM
DavidKucharski
New Contributor II

I have created a ASP .NET Web Application. I add a new Web Form and put the following code in the aspx page. This is the example in the getting started 2d example on the ESRI web-site. When I run the application I get an error stating 'The value of the property 'require' is null or undefined., not a Function object. Am I doing something wrong or do I need something else. I thought it was a DOM object and having the <script src="https://js.arcgis.com/4.3/"></script> tag would make it accessible. Thanks

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="Map_JavaScript_1.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Get started with MapView - Create a 2D map</title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
<script src="https://js.arcgis.com/4.3/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"dojo/domReady!"
], function (Map, MapView) {
var map = new Map({
basemap: "streets"
});
var view = new MapView({
container: "viewDiv", // Reference to the scene div created in step 5
map: map, // Reference to the map object created before the scene
zoom: 4, // Sets the zoom level based on level of detail (LOD)
center: [15, 65] // Sets the center point of view in lon/lat
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

David,


  What is your compatibility mode set to in your apps meta tag?

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

David,


  What is your compatibility mode set to in your apps meta tag?

0 Kudos
DavidKucharski
New Contributor II

Robert,

thank you for pointing me in the right direction. My site, for other reasons, was in Compatibility mode. Once I put the meta tag on the mapping site to be compatible with IE 11 it works.

0 Kudos