这是我的ASP Web控件
<a id="geoLocation" class="geolocate box-outline active full">
<div>
<div class="icon"></div>
<div class="header">
Locate Me Now
<asp:Label id="latitude" runat="server" ClientIdMode="Static"></asp:Label><br />
<asp:Label id="longitude" runat="server" ClientIdMode="Static"></asp:Label>
<div style="display:none">
<asp:Button ID="Button2" runat="server" Text="Button" ClientIdMode="Static" />
</div>
</div>
</div>
</a>
我试图做一个Postback以便能够访问我打算在其后隐藏的代码中的“经度”和“纬度”值。
这是我正在使用的Javascipt回发...我在做什么错?
function showPosition(position) {
// x.innerHTML = "Latitude: " + position.coords.latitude +
// "<br>Longitude: " + position.coords.longitude;
document.getElementById('latitude').innerHTML = position.coords.latitude;
document.getElementById('longitude').innerHTML = position.coords.longitude;
_doPostBack('#geoLocation', '');
}
试试这个:
_doPostBack('#geoLocation', ''); --> __doPostBack('#geoLocation', '');
在doPostBack方法的开头,您需要两个下划线。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句