Solved

google maps from codebehind

Posted on 2011-02-22
2
385 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&amp;source=s_q&amp;hl=da&amp;geocode=&amp;q=Jernbanegade+27,+Kolding&amp;aq=&amp;sll=55.491924,9.482296&amp;ie=UTF8&amp;hq=&amp;hnear=Jernbanegade+27,+6000+Kolding&amp;ll=55.495534,9.482489&amp;spn=0.017017,0.036478&amp;z=14&amp;iwloc=A&amp;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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

18 Experts available now in Live!

Get 1:1 Help Now