我想访问java脚本的返回值,它在一个变量和一个标签中,我想在.cs文件中使用它,我该怎么做?我已经在一个变量中获取了 javascript 的输出,还有一个 asp.net 的标签控件......我两种方式都得到了值,但是需要它.cs 文件来将它保存在我的数据 bsae 中,请帮助我。 。 感谢你
<script language=Javascript>
function setup_ip(json) {
var htmlx = " Your IP Address: <b>" + json.IP;
htmlx += "</b> | Country: " + json.countryName;
if (json.cityName != "Unknown" || json.regionName != "Unknown") {
htmlx += " | City: " + json.cityName + " / " + json.regionName;
var s = " | City: " + json.cityName + " / " + json.regionName;
} else {
htmlx += " | Your Time: " + json.localTimeZone;
}
$("#myipx").html(htmlx);
// $('#<%= lbl1.ClientID %>').text(htmlx);
$('#<%= lbl1.ClientID %>').text(s);
// var txtCountry = document.getElementById('<%=lbl1.ClientID %>');
}
$(document).ready(function() {
EasyjQuery_Get_IP("setup_ip", "full");
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div class="inner">
<p class="welcome-message">
<a href="http://www.easyjquery.com/detect-get-clients-ip-address-country-using-javascript-php/"id="topid" title="Javascript, PHP jQuery API Detect Clients IP Address and Country - Geo Location" >
<asp:Label ID="myipx" runat="server" ClientIDMode="Static"></a></asp:Label>Detecting Clients IP Address - Country - City</span>
<br />
<asp:Label ID="lbl1" runat="server" ClientIDMode="Static"></asp:Label>
</p>
<asp:TextBox ID="txtCountry" runat="server"></asp:TextBox>
<!-- END #footer-texture -->
</div>
</div>
</form>
</body>