How to send HTML geolocation latitude and longitude values from view to controller action method

I want a user to be able to get the closest user. So, I have to get the user’s longitude and latitude from the browser and send it to the OnPost action method below. Each time the user visits the website, the position is updated. NOTE: The point class which takes the coordinates in the controller, is from the NetTopologySuite library used for modelling and manipulating 2-dimensional linear geometry

How to send data from ajax to a base controller method that runs on every visited page

I want user’s latitude and longitude to be updated on every page visited. In order not to duplicate things, I created a base controller where I also implemented the onActionExecuting which allows the method to run every time on every action from the derived controllers, but I can’t figure out how to pass the latitude and longitude parameters since they are only passed from the browser through an Ajax call.