Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. @{
  2. ViewBag.Title = "Home Page";
  3. }
  4. @section Scripts {
  5. <script>
  6. var x = document.getElementById("demo");
  7. function getLocation() {
  8. if (navigator.geolocation) {
  9. navigator.geolocation.getCurrentPosition(showPosition);
  10. } else {
  11. x.innerHTML = "Geolocation is not supported by this browser.";
  12. }
  13. }
  14. function showPosition(position) {
  15. x.innerHTML = "Latitude: " + position.coords.latitude +
  16. "<br>Longitude: " + position.coords.longitude;
  17. }
  18. window.onload(getLocation());
  19. </script>
  20. }
  21.  
  22. <div id="demo"></div>
  23.  
  24. public async Task<ActionResult> Login(LoginViewModel model, string returnUrl) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement