将数据集值获取到.aspx页 [英] get dataset values to .aspx page

查看:75
本文介绍了将数据集值获取到.aspx页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...

我从纬度和经度等数据库获取数据集的值.我想将它们显示在google map.i上,希望将它们带到.aspx页面.我该怎么办.

预先感谢.

Hi...

I getting values from database like latitude and longitude to dataset. i order to display them on google map.i want to bring them to .aspx page. how can i do it.

Thanks in advance.

推荐答案



您可以使用2个受保护的变量.并将纬度和经度保存到该变量中.您可以在Java脚本的客户端获取该值.

Hi,

You can take 2 protected variable. And save latitude and longitude into that variable. You can get that value on the client side in java script.

var xyz = '<%= variable %>';



谢谢,
Viprat



Thanks,
Viprat


在Google地图中,您需要设置数据集中的值(纬度,经度)以在客户端(javascript)中可用.

您已经完成了填充部分,并获取了数据集中的值.

要在客户端获取值,
您可以创建两个隐藏字段,使其成为runat ="server"
In google map, you need to set the values(lat,long) from dataset to be available in your client side (javascript).

You have already done the populate part and get the values in dataset.

To get the values in client side,
you can create two hidden fields make it runat="server"
<input type="hidden" id="hdnLat" runat="server" />
<input type="hidden" id="hdnLong" runat="server" />

//Create a variable that can access the server side control
var objLat = docuent.getElementById("<%= hdnLat.ClientID %>");
var objLat = docuent.getElementById("<%= hdnLong.ClientID %>");



现在,在页面加载背后的代码中,使用数据集获取lat和Long值,并将其分配给上述两个变量.



Now in code behind page load, use the dataset to get the lat and Long value and assign it in the above two variable.

hdnLat.Value = {value from dataset};
hdnLong.Value = {value from dataset};



现在,您可以使用javascript在Google地图创建例程中使用值
objLat.value和objLong.value.

这应该起作用.

欢呼



In your google map creation routine in javascript, you can now use the value
objLat.value and objLong.value.

This should work.

cheers


这篇关于将数据集值获取到.aspx页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆