Adding google Maps to my web pages

I need to dynamically add the address to the code below, I have tried server tags and could not get them to work. the error stated that the variable did not exist in the current context when I used the server side tag inline in my webpage.  See "myLocations=" in the code, this is where I would like to insert the variable from my querystring that I captured using simple strings and or stringbuilder.
<body onload="initialize()" onunload="GUnload()"> <div align="center" id="map_canvas" style="width: 250px; height: 80px"></div> <div align="center" style="width: 250px; height: 80px"><script src=";up_myLocations=1121%20Spring%20Lake%20Dr%2C%20Itasca%2C%20IL&amp;synd=open&amp;w=400&amp;h=80&amp;title=DDC+Driving+Directions&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script></div></body>

Open in new window

Who is Participating?
I used the following code and all seemed to work. I replaced the address after up_MyLocations= with
<%= Request.querystring("address") %>
Then calling the page with any valid address (correctly encoded with %20 for spaces and %2C for commas) places the destination address in the correct box.

I have removed your javascript functions "initialize" and "GUnload" for the purpose of testing.
    <form id="form1" runat="server">
        <div align="center" id="map_canvas" style="width: 250px; height: 80px">
        <div align="center" style="width: 250px; height: 80px">
            <script type="text/javascript" 
            src=";up_myLocations=<%= Request.querystring("address") %>&amp;synd=open&amp;w=400&amp;h=80&amp;title=DDC+Driving+Directions&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>

Open in new window

bharris133Author Commented:
Great thanks by the way the syntax for requesting the querystring needed to be corrected.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.