-1

I have a ASP.Net Web form application project. I use Google iframe but it does not work. Please help me. My code:

Location="https://www.google.com/maps/place/%D8%B4%D8%B1%DA%A9%D8%AA+%D8%AC%D9%87%D8%A7%D9%86+%D8%B4%DB%8C%D9%85%DB%8C+%D8%A8%D8%B3%D9%BE%D8%A7%D8%B1%E2%80%AD/@35.7743752,51.3679948,14z/data=!4m8!1m2!2m1!1sjahan+shimi+baspar!3m4!1s0x0:0x9f32a31df4793a64!8m2!3d35.7721173!4d51.3661373"
    <iframe width="100%" height="400px" scrolling="no" 
src="location"></iframe>
SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
Nader
  • 1
  • 2
  • you need to use the google embeded maps api – Krsna Kishore Sep 06 '16 at 07:03
  • Please. So please, don't use iframe. I'm sure you can solve it somehow without iframe. use javascript/jquery/bootstrap/... but not iframe: http://stackoverflow.com/questions/23178505/good-reasons-why-not-to-use-iframes-in-page-content – Matthias Burger Sep 06 '16 at 07:11

2 Answers2

0

Just use google's provided embed code:

<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d25896.326046334627!2d51.3679948!3d35.7743752!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x9f32a31df4793a64!2z2LTYsdqp2Kog2KzZh9in2YYg2LTbjNmF24wg2KjYs9m-2KfYsQ!5e0!3m2!1sen!2sus!4v1473145596653" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
NickyTheWrench
  • 3,150
  • 1
  • 23
  • 35
0

Your src="location" doesn't automatically read some "location" variable/parameter/whatever, it just tries to use the value "location" as url and fails.

So you need to use some way to inject the contents of your Location variable as value of src.

How to do that depends on how you generate that HTML:

For webforms you may need something like src="<%= Location %>".
For MVC it will be something like src="@Location".

Hans Kesting
  • 38,117
  • 9
  • 79
  • 111