Hi Vitaly,
I am not sure I completely understood your example...so I will be more specific and use the actual urls that I am trying to use.
The purpose in the IFrame I'm trying to make was originally to display the boundary of the little league so that people could check if their house was within our boundary before registering. To do that I made a KML file, and then used live maps to display. At this point the IFrame worked great...Aside from the size properties etc, the only relevant one is the URL that the IFrame is supposed to display...it is: http://maps.live.com/default.aspx?v=2&cp=39.955149~-75.663357&style=r&lvl=12&tilt=-90&dir=0&alt=-1000&cid=85F0C8C6775871DD!116&encType=1
All of the parameters essentially control where the map zooms in and how much etc.
Next I was asked to provide a simple way for the user to keyin their address, and have a pushpin located on it so they could more easily check if they were in the boundary. To do this, I learned that all I have to do is add another parameter to the end of the query string that tells Virtual Earth what my address is and it takes care of the rest.
So, if we assume that I want to show a pushpin for the following address 1 W Street Rd, West Chester, PA 19382
Then I could modify the SRC tag of the Iframe to be:
http://maps.live.com/default.aspx?v=2&cp=39.955149~-75.663357&style=r&lvl=12&tilt=-90&dir=0&alt=-1000&cid=85F0C8C6775871DD!116&encType=1&sp=adr.1%20W%20Street%20Rd%2cWest%20Chester%2cPA%19382
I would quickly see that the address is outside of my boundary.
So, I copied the code from the IFrame module and thought I could simply change the IFrame.ascx page to show a textbox for street, city, state, zip and a button for the user to submit. Then in the codebehind I could do something like the following:
Protected
Sub btnAddress_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddress.ClickDim paramVal As String
paramVal =
"&sp=adr." & txtStreet.Text & "%2c" & txtCity.Text & "%2c" & txtState.Text & "%2c" & txtZip.Text
htmIFrame.Attributes("src") = htmIFrame.Attributes(
"src") & paramVal
End Sub
BUT, that doesn't seem to work b/c of something with encoding/decoding of the string. I haven't quite learned how to do this better yet.
Also, it doesn't really take into account if the "sp=..." param already exists on the query string.
Any suggestions on how better to do this?
Thanks in advance
Paul Hermans
I thought I might be able to do this using one of the query string parameter types in the IFRame module, but so far haven't found any example of how to do what I want.
I thought I could just do it in code behind of the button, but