<pre><!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <button onclick="getLocation()">Try It</button> <p id="demo"></p> <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } } function showPosition(position) { x.innerHTML = "Latitude: " + position.coords.latitude + "<br>Longitude: " + position.coords.longitude; } </script> </div> </form> </body> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration; namespace Mobile_based_attendance_system { public partial class display : System.Web.UI.Page { public SqlDataReader reader; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Page detail = (Page)Context.Handler; if (detail is login) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ToString()); con.Open(); string query = "select * from employee,dept_data where per_no='" + ((login)detail).perno + "' and employee.dept_e=dept_data.dept"; SqlCommand cmd = new SqlCommand(query, con); reader = cmd.ExecuteReader(); while(reader.Read()) { Label5.Text = reader["emp_name"].ToString(); Label6.Text = reader["deg"].ToString(); Label7.Text = reader["per_no"].ToString(); Label8.Text = reader["dept"].ToString(); } reader.Close(); } } } //Inside this I want to Compare Two Coordinates and occording to that i want to enable or disable the required button } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)