I am trying to call a web URL which contain parameters lat
and long
, and I want to call that web page multiple times until the asp application closes.
I am recieving the values whenever the aspx page is loaded but for getting updated values I have to refresh the page to call the page_Load
function again and again.
What I want is to get values from the url again and again without refreshing the aspx page.
//my code of my aspx.cs file
public partial class locationtesting : System.Web.UI.Page
{
public string longit, lat;
protected void Page_Load(object sender, EventArgs e)
{
try
{
WebClient client = new WebClient();
string downloadedString = client.DownloadString("url.php");
string[] tokens = downloadedString.Split(':');
string longitude = tokens[1];
string latitude = tokens[3];
this.longit = longitude;
this.lat = latitude;
}
catch (Exception ee)
{
Response.Write("Exception: "+ee);
}
}
}