尝试这样的事情: -
<script type="text/javascript">
function init()
{ bla bla bla
trigger: function (e) {
var lonlat = map.getLonLatFromPixel(e.xy);
N = lonlat.lat;
E = lonlat.lon;
document.getElementById("Hidden1").value=N;
document.getElementById("Hidden2").value=E;
alert("You are near hear: " + N + " N, " + E + " E");
}
</script>
<body>
<form id="form1" runat="server">
<div>
<input id="Hidden1" type="hidden" runat="server" />
<input id="Hidden2" type="hidden" runat="server" />
<asp:Button ID="Button1" runat="server" OnClientClick="init()" Text="Button"
onclick="Button1_Click" />
</div>
</form>
</body>
在后面的代码中: -
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(Hidden1.Value);
Response.Write(Hidden2.Value);
}