简体   繁体   English

通过使用C#单击按钮在Google地图中打开TextBox值(地址)

[英]Open TextBox value (address) in google maps by clicking button using c#

I got a question: I'm writing a short program, which the user is typing in his/her name, age and adsress. 我有一个问题:我正在编写一个简短的程序,用户输入他/她的姓名,年龄和广告客户。 after that, the user will click the "Load Data" button i created. 之后,用户将单击我创建的“加载数据”按钮。 then their address etc. will be listed in a new form. 那么他们的地址等将以新的形式列出。 and now i got a "Google Maps" button. 现在我有一个“ Google Maps”按钮。 so when they click the "google maps" button, it should open their browser on google maps and pointing at the address they typed in. someone got an idea? 因此,当他们单击“谷歌地图”按钮时,它应在谷歌地图上打开浏览器,并指向他们输入的地址。有人知道吗?

cheers 干杯

The current structure for Google Maps urls is ( source ): Google Maps网址的当前结构为( source ):

http://maps.google.com/maps?t=m&q=Location

So in order to do this, you would want to (assuming that you are using ASP.net): 因此,为了做到这一点,您需要(假设您正在使用ASP.net):

  1. On a click event for the GoogleMaps button, concatenate the address fields together 在GoogleMaps按钮的点击事件中,将地址字段连接在一起
  2. Use this structure to create a maps url using this in the q parameter (be sure to Html Encode) 使用此结构在q参数中使用此结构来创建地图网址(请务必使用HTML编码)
  3. Response.Redirect(googleMapsUrl);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以使用C#将Bing / Google地图自动填充邮政地址文本框放置在桌面Windows窗体应用程序中? - Is it possible to place Bing/Google Maps autocomplete postal address textbox in desktop windows form app using C#? 在C#中使用文本框中的数据库值打开特定的Windows窗体 - open specific windows form using database value in textbox in c# 如何获取谷歌地图标记的坐标并将其存储在文本框中或使用asp.net c#标签 - how to get the coordinates of google maps marker and store it in textbox or label using asp.net c# 双击标记Google Maps API C#iOS - Double Clicking marker google maps api c# ios 使用带有文本框的 c# 打开 pdf 文件 - Open a pdf file using c# with textbox CodeGo.net> XAML:如何通过单击文本框和按钮打开菜单? - c# - XAML: how to open an menu with textbox and button by button click? 单击按钮不正确的其他文本框中的文本框值 - Textbox value in other textbox by clicking button not correct C# 我想将文本框值与 combobox 中的所有项目进行比较。 单击按钮时出现异常 - C# I want to compare textbox value with all items in a combobox. I am getting an exception While clicking the button 使用文本框和按钮的C#Datagridview过滤器 - C# Datagridview filter using textbox and button 如何通过单击 C# 中的按钮打开 MDI 父级? - How to open an MDI parent by clicking on a button in C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM