Tuesday, May 24, 2022
HomeError SolveHow do I get an IP address in ASP.NET Core View

How do I get an IP address in ASP.NET Core View

If you want to access the current IP Address using Javascript in ASP.NET Core View then you need to write the code.

<script type="application/javascript">
  function getIP(json) {
    document.write("My public IP address is: ", json.ip);
  }
</script>
<script type="application/javascript" src="https://api.ipify.org?format=jsonp&callback=getIP"></script>

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments