OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to display google map in Iframe

  • Thread starter Thread starter SantyEssac
  • Start date Start date
S

SantyEssac

Guest
I want to display google maps in Razor MVC page but its not displaying and getting an error as follows:

Refused to display 'https://maps.google.com/maps/ms?ie=...XXX&ll=XXXXXXXXXX&spn=XXXXXXXXXX&output=embed' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

The code is as follows:

Code:
<div id="map" style="width: 251px; height: 202px;">
  <iframe id="iGmap" width="251" height="202" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="
http://maps.google.com/maps/ms?ie=UTF8&amp;hl=en&amp;msa=0&amp;msid=XXXXXXXXXXXXXXXXXXXXX&amp;ll=XXXXXXXXXXXXXXXX&amp;spn=XXXXXXXXXXXXX&amp;output=embed">
  </iframe>
</div>

<p>I want to display google maps in Razor MVC page but its not displaying and getting an error as follows:</p>

<p>Refused to display '<a href="https://maps.google.com/maps/ms?ie=...XXX&ll=XXXXXXXXXX&spn=XXXXXXXXXX&output=embed" rel="nofollow">https://maps.google.com/maps/ms?ie=...XXX&ll=XXXXXXXXXX&spn=XXXXXXXXXX&output=embed</a>' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.</p>

<p>The code is as follows:</p>

<pre><code><div id="map" style="width: 251px; height: 202px;">
<iframe id="iGmap" width="251" height="202" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="
http://maps.google.com/maps/ms?ie=U...XXXXXX&amp;spn=XXXXXXXXXXXXX&amp;output=embed">
</iframe>
</div>
</code></pre>
 
Top