I would like to know how to display an Esri Map on a ASP.Net MVC view from an HTML file.
I have an HTML file that contains a JavaScript code. This file can display the map and the widgets when I open it with any internet browser. It is working fine. But now I want to display that map on an ASP.Net MVC view. This is what I have done:
<SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"><h2</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #e64320; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">class</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">=</SPAN><SPAN class="" style="color: #0f74bd; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">"panel-title"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #e64320; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">data-toggle</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">=</SPAN><SPAN class="" style="color: #0f74bd; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">"collapse"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #e64320; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">href</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">=</SPAN><SPAN class="" style="color: #0f74bd; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">"#projectmap"</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">></SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">Project Map</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"></h2></SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"></SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"><div</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #e64320; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">id</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">=</SPAN><SPAN class="" style="color: #0f74bd; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">"projectmap"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #e64320; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">class</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">=</SPAN><SPAN class="" style="color: #0f74bd; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">"panel-collapse collapse"</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">></SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"><div</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #e64320; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">class</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">=</SPAN><SPAN class="" style="color: #0f74bd; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">"panel-body"</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">></SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"><div</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #e64320; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">class</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">=</SPAN><SPAN class="" style="color: #0f74bd; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">"form-group"</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;">></SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> @Html.Raw(File.ReadAllText(Server.MapPath("~/Views/Application/default.html"))) </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"></div></SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"> </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"></div></SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"></SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px; margin: 0px;"></div>
<SPAN style="color: #242729; background-color: #ffffff;">But it displays only the Sketch widget, it does not display the map. I have also tried to write the JavaScript code manually on the .cshtml file and use the div container to display the map, it still displays the Sketch widget only. I have also tried the partial views, it does not work.</SPAN></SPAN>