Get Client IP Address using API


Asp.Net Solution

<script type=”text/javascript”>
var Ip;
function getIP(json) {
Ip = json.ip;
}
$(document).ready(function () {
$(‘[id$=hdnIP]’).val(Ip);
});
</script>
<script type=”application/javascript”
src=”http://api.ipify.org?format=jsonp&callback=getIP”>
</script>

<asp:HiddenField ID=”hdnIP” runat=”server”/>

View original post