samedi 8 octobre 2016

call web url multiple times in asp.net.cx

I am trying to call a web URL which contains lat long, and i want to call that web page multiple times until asp application closes.
I am recieving the values whenever the aspx page is load 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);
    }
}

}




Aucun commentaire:

Enregistrer un commentaire