Solved

google maps from codebehind

Posted on 2011-02-22
2
386 Views
Last Modified: 2013-12-17
Hi guys.

I have a iframe at my .aspx page:
<iframe runat="server" id="gMapss" width="400" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>

From my .aspx.cs page I try :
gMapss.Attributes["src"] = "http://maps.google.dk/maps?f=q&source=s_q&hl=da&geocode=&q=Jernbanegade+27,+Kolding&aq=&sll=55.491924,9.482296&ie=UTF8&hq=&hnear=Jernbanegade+27,+6000+Kolding&ll=55.495534,9.482489&spn=0.017017,0.036478&z=14&iwloc=A&output=embed";
           
But it dosen´t work, It works if I parse the map code in the src="" at the .aspx page. Any suggessions?
0
Comment
Question by:bongii
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 34956605
I think it is because of all the escaped ampersands in there. Change it to:

gMapss.Attributes["src"] = "http://maps.google.dk/maps?f=q&source=s_q&hl=da&geocode=&q=Jernbanegade+27,+Kolding&amp;aq=&sll=55.491924,9.482296&ie=UTF8&hq=&hnear=Jernbanegade+27,+6000+Kolding&ll=55.495534,9.482489&spn=0.017017,0.036478&z=14&iwloc=A&output=embed";

Open in new window

0
 

Author Comment

by:bongii
ID: 34958620
Thank you :)
Do you know how to show the map only by Latiture and longitude? I don´t have the adress..
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now