[英]How do i use an asp.net variable value in javascript
i have a asp.net application. 我有一个asp.net应用程序。 It is assumed that every Bus has a android device which continuously sends its current location to wcf rest service.
假定每辆公共汽车都有一个android设备,该设备连续将其当前位置发送到wcf rest服务。 Now the administrator on the other side needs to monitor the current location of theses buses.
现在,另一端的管理员需要监视这些总线的当前位置。 I have a dropdow list from where he chooses the bus number.
我有一个下拉列表,他可以从中选择公共汽车号码。 now i need to send this bus number to the wcf service and show the current location on the map I have no clue as to how do i do this.
现在,我需要将此总线号发送到wcf服务,并在地图上显示当前位置,但我不知道如何执行此操作。 please help.
请帮忙。 The plotting algorithm is in javascript and i need to use the asp.net variable in java script to plot the current loacation.
绘图算法在javascript中,我需要在Java脚本中使用asp.net变量来绘制当前位置。
to get the dropdownlist value use this code: 要获取dropdownlist值,请使用以下代码:
var ddl= document.getElementById("<%= yourDDLId.ClientID %>")
var select= ddl.options[ddl.selectedIndex].text;
and sometimes it works also if you write only: 如果您只写以下内容,有时也可以使用:
var ddl= document.getElementById("yourDDLId")
var select= ddl.options[ddl.selectedIndex].text;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.